Skip to content

Replace focus_room_filter dispatch by Action.OpenSpotlight#29259

Merged
florianduros merged 2 commits into
developfrom
florianduros/remove-focus_room_filter
Feb 13, 2025
Merged

Replace focus_room_filter dispatch by Action.OpenSpotlight#29259
florianduros merged 2 commits into
developfrom
florianduros/remove-focus_room_filter

Conversation

@florianduros
Copy link
Copy Markdown
Member

@florianduros florianduros commented Feb 13, 2025

This PR removes the focus_room_filter action and replaces it by Action.OpenSpotlight.

  1. focus_room_filter is fired when KeyBindingAction.FilterRooms is triggered:

    case KeyBindingAction.FilterRooms:
    dis.dispatch({
    action: "focus_room_filter",
    });
    handled = true;
    break;

  2. Which is handled by RoomSearch, to directly open the spotlight:

    public componentDidMount(): void {
    this.dispatcherRef = defaultDispatcher.register(this.onAction);
    }
    public componentWillUnmount(): void {
    defaultDispatcher.unregister(this.dispatcherRef);
    }
    private openSpotlight(): void {
    defaultDispatcher.fire(Action.OpenSpotlight);
    }
    private onAction = (payload: ActionPayload): void => {
    if (payload.action === "focus_room_filter") {
    this.openSpotlight();
    }
    };

  3. We can directly ditch focus_room_filter and opens the spotlight:

    case KeyBindingAction.FilterRooms:
    dis.fire(Action.OpenSpotlight);
    handled = true;
    break;

@florianduros florianduros added this pull request to the merge queue Feb 13, 2025
Merged via the queue into develop with commit 85f80b1 Feb 13, 2025
@florianduros florianduros deleted the florianduros/remove-focus_room_filter branch February 13, 2025 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-Task Tasks for the team like planning

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants