mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-08 05:03:39 +08:00
refactor: use await instead of .then
This commit is contained in:
parent
aa54695477
commit
26b81f7fa0
1 changed files with 5 additions and 12 deletions
|
|
@ -390,21 +390,14 @@ list["removeGoogleAuth"] = new SimplePopup(
|
|||
await reauthenticateWithCredential(user, credential);
|
||||
}
|
||||
Loader.show();
|
||||
unlink(user, "google.com")
|
||||
.then(() => {
|
||||
Loader.hide();
|
||||
Notifications.add("Google authentication removed", 1);
|
||||
Settings.updateAuthSections();
|
||||
return true;
|
||||
})
|
||||
.catch((error) => {
|
||||
Loader.hide();
|
||||
Notifications.add("Something went wrong: " + error.message, -1);
|
||||
return false;
|
||||
});
|
||||
await unlink(user, "google.com");
|
||||
Loader.hide();
|
||||
Notifications.add("Google authentication removed", 1);
|
||||
Settings.updateAuthSections();
|
||||
setTimeout(() => {
|
||||
window.location.reload();
|
||||
}, 3000);
|
||||
return true;
|
||||
} catch (e) {
|
||||
const typedError = e as FirebaseError;
|
||||
if (typedError.code === "auth/wrong-password") {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue