diff --git a/src/client/action/logout.js b/src/client/action/logout.js index 3c7b848..c4047bb 100644 --- a/src/client/action/logout.js +++ b/src/client/action/logout.js @@ -1,13 +1,16 @@ import initMatrix from '../initMatrix'; -function logout() { +async function logout() { const mx = initMatrix.matrixClient; mx.stopClient(); - mx.logout().then(() => { - mx.clearStores(); - window.localStorage.clear(); - window.location.reload(); - }); + try { + await mx.logout(); + } catch { + // ignore if failed to logout + } + mx.clearStores(); + window.localStorage.clear(); + window.location.reload(); } export default logout;