From 4025503b9c5a9d03b4d575762e3eda0b3f6ce3ec Mon Sep 17 00:00:00 2001 From: sy-b <94835959+sy-b@users.noreply.github.com> Date: Fri, 22 Apr 2022 10:19:37 +0530 Subject: [PATCH] Update ryd.background.js 1. Race condition between two async calls 2. We don't need to rewrite the variable every time a page is open. https://github.com/Anarios/return-youtube-dislike/pull/537#discussion_r855432386 --- Extensions/combined/ryd.background.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Extensions/combined/ryd.background.js b/Extensions/combined/ryd.background.js index 4139bbe..0870dd7 100644 --- a/Extensions/combined/ryd.background.js +++ b/Extensions/combined/ryd.background.js @@ -74,12 +74,12 @@ api.runtime.onMessage.addListener((request, sender, sendResponse) => { } }); -api.storage.sync.get(['newInstallation'], (result) => { - if (result.newInstallation !== false) { +api.storage.sync.get(['showChangelog'], (details) => { + if (details.showChangelog !== false) { api.tabs.create({url: api.runtime.getURL("/changelog/3/changelog_3.0.html")}); + api.storage.sync.set({'showChangelog': false}); } }); -api.storage.sync.set({'newInstallation': false}); async function sendVote(videoId, vote) { api.storage.sync.get(null, async (storageResult) => {