Skip to content

Commit

Permalink
Ensure switching rooms does not wrongly focus timeline search
Browse files Browse the repository at this point in the history
This happened due to the focusRoomSearch param being stored for inactive rooms so it never got cleared

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
  • Loading branch information
t3chguy committed Jan 31, 2025
1 parent dcce9c7 commit af5e7d5
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/stores/right-panel/RightPanelStoreIPanelState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ export interface IRightPanelCardStateStored {
initialEventId?: string;
isInitialEventHighlighted?: boolean;
initialEventScrollIntoView?: boolean;
// room summary card
focusRoomSearch?: boolean;
}

export interface IRightPanelCard {
Expand Down Expand Up @@ -84,7 +82,6 @@ export function convertCardToStore(panelState: IRightPanelCard): IRightPanelCard
memberInfoEventId: !!state?.memberInfoEvent?.getId() ? state.memberInfoEvent.getId() : undefined,
initialEventId: !!state?.initialEvent?.getId() ? state.initialEvent.getId() : undefined,
memberId: !!state?.member?.userId ? state.member.userId : undefined,
focusRoomSearch: state.focusRoomSearch,
};

return { state: stateStored, phase: panelState.phase };
Expand All @@ -104,7 +101,6 @@ function convertStoreToCard(panelStateStore: IRightPanelCardStored, room: Room):
: undefined,
initialEvent: !!stateStored?.initialEventId ? room.findEventById(stateStored.initialEventId) : undefined,
member: (!!stateStored?.memberId && room.getMember(stateStored.memberId)) || undefined,
focusRoomSearch: stateStored?.focusRoomSearch,
};

return { state: state, phase: panelStateStore.phase };
Expand Down

0 comments on commit af5e7d5

Please sign in to comment.