Skip to content

Commit

Permalink
Do not restore last URL to session picker when there is one session
Browse files Browse the repository at this point in the history
psrpinto committed Jun 6, 2023
1 parent 3b332b1 commit 61342a0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions frontend/iframe/viewmodels/RootViewModel.ts
Original file line number Diff line number Diff line change
@@ -173,10 +173,11 @@ export class RootViewModel extends ViewModel<SegmentType, Options> {
shouldRestoreLastUrl = false;
}

// Do not restore last URL to session picker if we're in single-room mode and there are no sessions.
// We do this so that we can try guest login in that scenario.
// Do not restore last URL to session picker if we're in single-room mode and there are zero or one sessions.
// We do this so that we can try guest login when there are no sessions, or in the case where there is one
// session, use that session.
const willShowSessionPicker = this.platform.history.getLastSessionUrl() === "#/session";
if (shouldRestoreLastUrl && willShowSessionPicker && sessionInfos.length === 0) {
if (shouldRestoreLastUrl && willShowSessionPicker && sessionInfos.length <= 1) {
shouldRestoreLastUrl = false;
}
}

0 comments on commit 61342a0

Please sign in to comment.