Fix signout sequence not cleaning up correctly
Potentially closes 1319 ## Note - `persistor.purge` returns a promise, we should wait for the resolved results before reloading, instead of just adding an arbitrary `setTimeout`. - Perhaps the `setTimeout` method is to ignore a super-long or hanged purge (not sure), but it wouldn't be right since it would end up in a limbo state. - Log errors to get clues for future. - Reduced code by moving the reload to `finally`.
This commit is contained in:
parent
f7cb0e40cc
commit
5288fb3de8
1 changed files with 4 additions and 6 deletions
|
@ -550,15 +550,13 @@ export function doSignOut() {
|
||||||
.then(doSignOutCleanup)
|
.then(doSignOutCleanup)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
// @if TARGET='web'
|
// @if TARGET='web'
|
||||||
window.persistor.purge();
|
return window.persistor.purge();
|
||||||
// @endif
|
// @endif
|
||||||
})
|
})
|
||||||
.then(() => {
|
.catch((err) => {
|
||||||
setTimeout(() => {
|
analytics.error(`\`doSignOut\`: ${err.message || err}`);
|
||||||
location.reload();
|
|
||||||
});
|
|
||||||
})
|
})
|
||||||
.catch(() => location.reload());
|
.finally(() => location.reload());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue