mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-02-01 23:21:40 +01:00
Merge pull request #916 from vector-im/bwindels/fix-logout-button-on-load-error
Fix logout not working when there is a session load error
This commit is contained in:
commit
430464c829
@ -154,7 +154,7 @@ export class SessionLoadViewModel extends ViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async logout() {
|
async logout() {
|
||||||
await this._client.logout();
|
await this._client.startLogout(this.navigation.path.get("session").value);
|
||||||
this.navigation.push("session", true);
|
this.navigation.push("session", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,11 +78,15 @@ export class StorageFactory {
|
|||||||
return new Storage(db, this._idbFactory, this._IDBKeyRange, hasWebkitEarlyCloseTxnBug, this._localStorage, log.logger);
|
return new Storage(db, this._idbFactory, this._IDBKeyRange, hasWebkitEarlyCloseTxnBug, this._localStorage, log.logger);
|
||||||
}
|
}
|
||||||
|
|
||||||
delete(sessionId: string): Promise<IDBDatabase> {
|
async delete(sessionId: string): Promise<void> {
|
||||||
const databaseName = sessionName(sessionId);
|
const databaseName = sessionName(sessionId);
|
||||||
clearKeysFromLocalStorage(this._localStorage, databaseName);
|
try {
|
||||||
const req = this._idbFactory.deleteDatabase(databaseName);
|
clearKeysFromLocalStorage(this._localStorage, databaseName);
|
||||||
return reqAsPromise(req);
|
} catch (e) {}
|
||||||
|
try {
|
||||||
|
const req = this._idbFactory.deleteDatabase(databaseName);
|
||||||
|
await reqAsPromise(req);
|
||||||
|
} catch (e) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
async export(sessionId: string, log: ILogItem): Promise<Export> {
|
async export(sessionId: string, log: ILogItem): Promise<Export> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user