mirror of
https://github.com/chinchang/web-maker.git
synced 2025-07-26 08:11:17 +02:00
fix sharing n auth flow
This commit is contained in:
13
src/utils.js
13
src/utils.js
@@ -417,7 +417,7 @@ export function getCompleteHtml(html, css, js, item, isForExport) {
|
||||
? chrome.extension.getURL('lib/screenlog.js')
|
||||
: `${location.origin}${
|
||||
window.DEBUG ? '' : BASE_PATH
|
||||
}/lib/screenlog.js`) +
|
||||
}/lib/screenlog.js`) +
|
||||
'"></script>';
|
||||
}
|
||||
|
||||
@@ -661,3 +661,14 @@ export function showConfetti(time = 4) {
|
||||
}
|
||||
})();
|
||||
}
|
||||
|
||||
/**
|
||||
* Persists the firebase user with a subset of it's keys.
|
||||
* @param {object} user User object from firebase
|
||||
*/
|
||||
export function persistAuthUserLocally(user) {
|
||||
const keys = ['uid', 'displayName', 'photoURL', 'isPro', 'settings'];
|
||||
const obj = {};
|
||||
keys.map(key => (obj[key] = user[key]));
|
||||
window.localStorage.setItem('user', JSON.stringify(obj));
|
||||
}
|
||||
|
Reference in New Issue
Block a user