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:
@@ -87,18 +87,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function setUserLastSeenVersion(version) {
|
async function setUserLastSeenVersion(version) {
|
||||||
if (window.IS_EXTENSION) {
|
// 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(
|
chrome.storage.sync.set(
|
||||||
{
|
{
|
||||||
lastSeenVersion: version
|
lastSeenVersion: version
|
||||||
},
|
},
|
||||||
function() {}
|
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 });
|
|
||||||
if (window.user) {
|
if (window.user) {
|
||||||
const remoteDb = await getDb();
|
const remoteDb = await getDb();
|
||||||
remoteDb
|
remoteDb
|
||||||
|
Reference in New Issue
Block a user