Skip to content

Commit

Permalink
Clear thread panel event permalink when changing rooms (#11024)
Browse files Browse the repository at this point in the history
To not get you stuck being constantly bounced to the middle of a thread
  • Loading branch information
t3chguy committed Jun 5, 2023
1 parent df4bc1e commit 267188d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/stores/right-panel/RightPanelStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,13 @@ export default class RightPanelStore extends ReadyWatchingStore {
);
}
}
// when we're switching to a room, clear out thread permalinks to not get you stuck in the middle of the thread
// in order to fix https://github.com/matrix-org/matrix-react-sdk/pull/11011
if (this.currentCard?.phase === RightPanelPhases.ThreadView) {
this.currentCard.state.initialEvent = undefined;
this.currentCard.state.isInitialEventHighlighted = undefined;
this.currentCard.state.initialEventScrollIntoView = undefined;
}

// If the right panel stays open mode is used, and the panel was either
// closed or never shown for that room, then force it open and display
Expand Down

0 comments on commit 267188d

Please sign in to comment.