fix: preventSilentAccess

This commit is contained in:
thecodrr
2020-12-10 10:02:50 +05:00
parent 7a3b11a42d
commit dc751c3712
2 changed files with 7 additions and 2 deletions

View File

@@ -32,6 +32,13 @@ class UserStore extends BaseStore {
});
});
EV.subscribe("db:sync", () => this.sync(false));
EV.subscribe("user:loggedOut", async () => {
if (window.PasswordCredential) {
await navigator.credentials.preventSilentAccess();
if (navigator.credentials.requireUserMediation)
await navigator.credentials.requireUserMediation();
}
});
await this.sync();
return true;
});

View File

@@ -191,8 +191,6 @@ function Settings(props) {
variant="list"
onClick={async () => {
if (await showLogoutConfirmation()) {
if (window.PasswordCredential)
await navigator.credentials.preventSilentAccess();
await logout();
}
}}