mirror of
https://github.com/chinchang/web-maker.git
synced 2025-07-07 23:22:43 +02:00
handle multitab error.
This commit is contained in:
@ -1,5 +1,3 @@
|
|||||||
/* global trackEvent */
|
|
||||||
|
|
||||||
window.logout = function logout() {
|
window.logout = function logout() {
|
||||||
firebase.auth().signOut();
|
firebase.auth().signOut();
|
||||||
};
|
};
|
||||||
@ -20,7 +18,7 @@ function login(providerName) {
|
|||||||
.auth()
|
.auth()
|
||||||
.signInWithPopup(provider)
|
.signInWithPopup(provider)
|
||||||
.then(function() {
|
.then(function() {
|
||||||
trackEvent('fn', 'loggedIn', providerName);
|
window.trackEvent('fn', 'loggedIn', providerName);
|
||||||
// Save to recommend next time
|
// Save to recommend next time
|
||||||
window.db.local.set({ lastAuthProvider: providerName });
|
window.db.local.set({ lastAuthProvider: providerName });
|
||||||
})
|
})
|
||||||
|
@ -58,7 +58,10 @@
|
|||||||
if (err.code === 'failed-precondition') {
|
if (err.code === 'failed-precondition') {
|
||||||
// Multiple tabs open, persistence can only be enabled
|
// Multiple tabs open, persistence can only be enabled
|
||||||
// in one tab at a a time.
|
// in one tab at a a time.
|
||||||
// ...
|
alert(
|
||||||
|
"Opening Web Maker web app in multiple tabs isn't supported at present and it seems like you already have it opened in another tab. Please use in one tab."
|
||||||
|
);
|
||||||
|
window.trackEvent('fn', 'multiTabError');
|
||||||
} else if (err.code === 'unimplemented') {
|
} else if (err.code === 'unimplemented') {
|
||||||
// The current browser does not support all of the
|
// The current browser does not support all of the
|
||||||
// features required to enable persistence
|
// features required to enable persistence
|
||||||
|
Reference in New Issue
Block a user