1
0
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:
Kushagra Gour
2024-04-29 14:20:42 +05:30
parent aa614ec4e3
commit 2e143fb782
4 changed files with 45 additions and 12 deletions

View File

@@ -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));
}