Skip to content

Commit 0b805d3

Browse files
committed
Fix update opening changelog for each tab
1 parent a501d7f commit 0b805d3

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nebulaenhance",
3-
"version": "1.0.10",
3+
"version": "1.0.11",
44
"private": true,
55
"description": "Enhancer for Nebula. Adds some quality of life features to the nebula player.",
66
"type": "module",

src/scripts/background_script.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Creator, loadCreators as _loadCreators, creatorHasNebulaVideo, creatorHasYTVideo, existsNebulaVideo, normalizeString } from './background';
2-
import { BrowserMessage, getBrowserInstance, getFromStorage, nebulavideo, parseTypeObject } from './helpers/sharedExt';
2+
import { BrowserMessage, getBrowserInstance, getFromStorage, nebulavideo, parseTypeObject, setToStorage } from './helpers/sharedExt';
33

44
const videoFetchYt = 50;
55
const videoFetchNebula = 50;
@@ -34,11 +34,17 @@ getBrowserInstance().runtime.onInstalled.addListener(async (details) => {
3434
if (details.reason === 'install') openOptions(true, 'show-changelogs');
3535
});
3636

37+
let isHandlingChangelog = false;
3738
const openChangelog = async () => {
39+
if (isHandlingChangelog) return;
40+
isHandlingChangelog = true;
3841
const { showChangelogs: show, lastVersion: version } = await getFromStorage({ showChangelogs: true, lastVersion: '-1' });
3942
console.debug({ show, version }, 'open changelogs?', show && version !== getBrowserInstance().runtime.getManifest().version);
40-
if (show && version !== getBrowserInstance().runtime.getManifest().version)
43+
const actualVersion = getBrowserInstance().runtime.getManifest().version;
44+
if (show && version !== actualVersion)
4145
openOptions(false, 'show-changelogs');
46+
await setToStorage({ lastVersion: actualVersion });
47+
isHandlingChangelog = false;
4248
};
4349

4450
const loadCreators = (() => {

0 commit comments

Comments
 (0)