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:
21
src/db.js
21
src/db.js
@@ -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
|
||||
|
Reference in New Issue
Block a user