1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-08-02 11:30:22 +02:00

db: refactor setLastSeenVersion logic

This commit is contained in:
Kushagra Gour
2018-01-21 17:39:25 +05:30
parent d67526588d
commit 80dabd446d

View File

@@ -87,18 +87,15 @@
}
async function setUserLastSeenVersion(version) {
if (window.IS_EXTENSION) {
chrome.storage.sync.set(
{
lastSeenVersion: version
},
function() {}
);
return;
}
// Settings the lastSeenVersion in localStorage also because next time we need
// to fetch it irrespective of the user being logged in or out
local.set({ lastSeenVersion: version });
// Setting the `lastSeenVersion` in localStorage(sync for extension) always
// because next time we need to fetch it irrespective of the user being
// logged in or out quickly from local storage.
chrome.storage.sync.set(
{
lastSeenVersion: version
},
function() {}
);
if (window.user) {
const remoteDb = await getDb();
remoteDb