Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metaspace Other rooms(MetaSpace.Orphans) now also affected by MetaSpace Featureflags #95

Merged
merged 3 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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