Skip to content

Commit

Permalink
fix: Logout flow (#6250)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyaiox authored Oct 2, 2024
1 parent 5092dfe commit 0dbfb81
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions browser-interface/packages/shared/session/sagas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,7 @@ function* authenticate(action: AuthenticateAction) {
// 3. continue with signin/signup (only not in preview)
let isSignUp = avatar.version <= 0 && !PREVIEW
if (getFeatureFlagVariantName(store.getState(), 'seamless_login_variant') === 'enabled') {

const isNewUser : boolean = avatar.version <= 0
const isNewUser: boolean = avatar.version <= 0
const tosAccepted: boolean = !!((yield call(getFromPersistentStorage, 'tos_popup_accepted')) as boolean)
const tosShown: boolean = !!((yield call(getFromPersistentStorage, 'tos_popup_shown')) as boolean)
isSignUp = !PREVIEW && (isNewUser || tosShown) && !tosAccepted
Expand All @@ -170,7 +169,10 @@ function* SetupTutorial() {
// from the renderer
const onboardingRealmName: string | undefined = yield select(getFeatureFlagVariantName, 'new_tutorial_variant')
const isNewTutorialDisabled =
onboardingRealmName === 'disabled' || onboardingRealmName === 'undefined' || HAS_INITIAL_POSITION_MARK || HAS_INITIAL_REALM_MARK
onboardingRealmName === 'disabled' ||
onboardingRealmName === 'undefined' ||
HAS_INITIAL_POSITION_MARK ||
HAS_INITIAL_REALM_MARK
if (!isNewTutorialDisabled) {
try {
const realm: string | undefined = yield select(getFeatureFlagVariantValue, 'new_tutorial_variant')
Expand Down Expand Up @@ -338,12 +340,11 @@ function* logout() {
if (identity && identity.address && network) {
yield call(() => localProfilesRepo.remove(identity.address, network))
yield call(deleteSession, identity.address)
// Page reload is called in the system that is listening to this event
globalObservable.emit('logout', { address: identity.address, network })
}

yield put(setRoomConnection(undefined))

window.location.reload()
}

function* redirectToSignUp() {
Expand Down

0 comments on commit 0dbfb81

Please sign in to comment.