Skip to content

Commit

Permalink
Merge pull request #95 from verji/jts/2039-hide-other-rooms+
Browse files Browse the repository at this point in the history
Metaspace Other rooms(MetaSpace.Orphans) now also affected by MetaSpace Featureflags
  • Loading branch information
JohnSimonsen authored Oct 2, 2024
2 parents 7e690bc + d950e1e commit 317d230
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 15 deletions.
19 changes: 11 additions & 8 deletions src/components/structures/LeftPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ limitations under the License.
import * as React from "react";
import { createRef } from "react";
import classNames from "classnames";
import {
CustomComponentLifecycle,
CustomComponentOpts,
} from "@matrix-org/react-sdk-module-api/lib/lifecycles/CustomComponentLifecycle";

import dis from "../../dispatcher/dispatcher";
import { _t } from "../../languageHandler";
Expand Down Expand Up @@ -46,10 +50,6 @@ import PageType from "../../PageTypes";
import { UserOnboardingButton } from "../views/user-onboarding/UserOnboardingButton";
import SettingsStore from "../../settings/SettingsStore";
import { ModuleRunner } from "../../modules/ModuleRunner";
import {
CustomComponentLifecycle,
CustomComponentOpts,
} from "@matrix-org/react-sdk-module-api/lib/lifecycles/CustomComponentLifecycle";

interface IProps {
isMinimized: boolean;
Expand Down Expand Up @@ -361,9 +361,12 @@ export default class LeftPanel extends React.Component<IProps, IState> {
);
}

const customNewsOpts = { CustomComponent: React.Fragment };
ModuleRunner.instance.invoke(CustomComponentLifecycle.NewsAndOperatingMessages, customNewsOpts as CustomComponentOpts);
return (
const customNewsOpts = { CustomComponent: React.Fragment };
ModuleRunner.instance.invoke(
CustomComponentLifecycle.NewsAndOperatingMessages,
customNewsOpts as CustomComponentOpts,
);
return (
<div
className="mx_LeftPanel_filterContainer"
onFocus={this.onFocus}
Expand All @@ -374,7 +377,7 @@ export default class LeftPanel extends React.Component<IProps, IState> {
<RoomSearch isMinimized={this.props.isMinimized} />

{dialPadButton}
<customNewsOpts.CustomComponent/>
<customNewsOpts.CustomComponent />
{rightButton}
</div>
);
Expand Down
11 changes: 4 additions & 7 deletions src/components/views/dialogs/InviteDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,8 @@ export default class InviteDialog extends React.PureComponent<Props, IInviteDial
// VERJI added param activeSpaceMembers - used to filter the recents based on membership in space
public static buildRecents(excludedTargetIds: Set<string>, activeSpaceMembers: string[]): Result[] {
// Verji - If we don't want to see the Recents-suggestions(featureflag), we just return an empty array
if(!SettingsStore.getValue(UIFeature.ShowRecentsInSuggestions)){
return [] as Result[]
if (!SettingsStore.getValue(UIFeature.ShowRecentsInSuggestions)) {
return [] as Result[];
}
const rooms = DMRoomMap.shared().getUniqueRoomsWithIndividuals(); // map of userId => js-sdk Room

Expand Down Expand Up @@ -688,11 +688,8 @@ export default class InviteDialog extends React.PureComponent<Props, IInviteDial
...this.state.serverResultsMixin,
...this.state.threepidResultsMixin,
];
}
else if(SettingsStore.getValue(UIFeature.ShowRecentsInSuggestions)){
possibleMembers = [
...this.state.recents
];
} else if (SettingsStore.getValue(UIFeature.ShowRecentsInSuggestions)) {
possibleMembers = [...this.state.recents];
}
const toAdd = [];
const potentialAddresses = this.state.filterText
Expand Down
2 changes: 2 additions & 0 deletions src/components/views/rooms/RoomList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ const DmAuxButton: React.FC<IAuxButtonProps> = ({ tabIndex, dispatcher = default
case MetaSpace.Home:
case MetaSpace.Favourites:
case MetaSpace.People:
case MetaSpace.Orphans:
showStartChatPlusMenuForMetaSpace = false;
break;

Expand Down Expand Up @@ -371,6 +372,7 @@ const UntaggedAuxButton: React.FC<IAuxButtonProps> = ({ tabIndex }) => {
case MetaSpace.Home:
case MetaSpace.Favourites:
case MetaSpace.People:
case MetaSpace.Orphans:
ShowAddRoomPlusMenuForMetaSpace = false;
break;

Expand Down
1 change: 1 addition & 0 deletions src/components/views/rooms/RoomListHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@ const RoomListHeader: React.FC<IProps> = ({ onVisibilityChange }) => {
case MetaSpace.Home:
case MetaSpace.Favourites:
case MetaSpace.People:
case MetaSpace.Orphans:
showPlusMenuForMetaSpace = false;
break;

Expand Down

0 comments on commit 317d230

Please sign in to comment.