Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Logout flow #6250

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading