Fix logout not working when server offline

This commit is contained in:
Ajay Bura 2022-08-11 13:41:07 +05:30
parent fbab53af22
commit 1692098d5d

View file

@ -1,13 +1,16 @@
import initMatrix from '../initMatrix';
function logout() {
async function logout() {
const mx = initMatrix.matrixClient;
mx.stopClient();
mx.logout().then(() => {
try {
await mx.logout();
} catch {
// ignore if failed to logout
}
mx.clearStores();
window.localStorage.clear();
window.location.reload();
});
}
export default logout;