Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Make dead code analysis lint happier
Browse files Browse the repository at this point in the history
  • Loading branch information
justjanne committed Aug 11, 2022
1 parent 1440301 commit a2eef46
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 5 additions & 2 deletions src/components/structures/MatrixChat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -700,7 +700,10 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
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();
Expand Down
6 changes: 2 additions & 4 deletions src/components/views/dialogs/spotlight/SpotlightDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<HTMLElement>): boolean {
return ref.current?.id?.startsWith("mx_SpotlightDialog_button_recentlyViewed_") === true;
}
Expand Down Expand Up @@ -1249,3 +1245,5 @@ const RovingSpotlightDialog: React.FC<IDialogProps & SpotlightProps> = (props) =
{ () => <SpotlightDialog {...props} /> }
</RovingTabIndexProvider>;
};

export default RovingSpotlightDialog;

0 comments on commit a2eef46

Please sign in to comment.