diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index b0d9987ee4d4..6936e7eb012a 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -134,7 +134,7 @@ import { RightPanelPhases } from "../../stores/right-panel/RightPanelStorePhases import RightPanelStore from "../../stores/right-panel/RightPanelStore"; import { TimelineRenderingType } from "../../contexts/RoomContext"; import { UseCaseSelection } from '../views/elements/UseCaseSelection'; -import { Filter, openSpotlight } from '../views/dialogs/spotlight/SpotlightDialog'; +import SpotlightDialog, { Filter } from '../views/dialogs/spotlight/SpotlightDialog'; import { OpenSpotlightPayload } from '../../dispatcher/payloads/OpenSpotlightPayload'; import { ValidatedServerConfig } from '../../utils/ValidatedServerConfig'; import { isLocalRoom } from '../../utils/localRoom/isLocalRoom'; @@ -700,7 +700,10 @@ export default class MatrixChat extends React.PureComponent { this.viewSomethingBehindModal(); break; case Action.OpenSpotlight: { - openSpotlight({ initialText: payload.initialText, initialFilter: payload.initialFilter }); + Modal.createDialog(SpotlightDialog, { + initialText: payload.initialText, + initialFilter: payload.initialFilter, + }, "mx_SpotlightDialog_wrapper", false, true); // View the welcome or home page if we need something to look at this.viewSomethingBehindModal(); diff --git a/src/components/views/dialogs/spotlight/SpotlightDialog.tsx b/src/components/views/dialogs/spotlight/SpotlightDialog.tsx index a4fe05b98db7..8e1a18ab2264 100644 --- a/src/components/views/dialogs/spotlight/SpotlightDialog.tsx +++ b/src/components/views/dialogs/spotlight/SpotlightDialog.tsx @@ -102,10 +102,6 @@ interface SpotlightProps { initialFilter?: Filter; } -export function openSpotlight(props: SpotlightProps = {}) { - Modal.createDialog(RovingSpotlightDialog, props, "mx_SpotlightDialog_wrapper", false, true); -} - function refIsForRecentlyViewed(ref: RefObject): boolean { return ref.current?.id?.startsWith("mx_SpotlightDialog_button_recentlyViewed_") === true; } @@ -1249,3 +1245,5 @@ const RovingSpotlightDialog: React.FC = (props) = { () => } ; }; + +export default RovingSpotlightDialog;