Created
September 2, 2019 04:16
-
-
Save rdlabo/5359725aeb7ca5588632e69047b99fda to your computer and use it in GitHub Desktop.
reload
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let isAlert = false; | |
setTimeout(() => { | |
if (!isAlert) { | |
// Alertをだしてユーザが選択したらreload | |
} | |
}, 2000); <= Timeout時間 | |
this.afAuth.auth.currentUser.getIdToken(false) | |
.then() | |
.finally(() => isAlert = true); | |
// なぜかうまくいかなかったPromise.race | |
return Promise.race([ | |
this.afAuth.auth.currentUser.getIdToken(false), | |
new Promise((resolve, reject) => { | |
setTimeout(() => reject(), this.timeoutDefault); | |
}), | |
]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment