|
1 | 1 | 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'; |
3 | 3 |
|
4 | 4 | const videoFetchYt = 50; |
5 | 5 | const videoFetchNebula = 50; |
@@ -34,11 +34,17 @@ getBrowserInstance().runtime.onInstalled.addListener(async (details) => { |
34 | 34 | if (details.reason === 'install') openOptions(true, 'show-changelogs'); |
35 | 35 | }); |
36 | 36 |
|
| 37 | +let isHandlingChangelog = false; |
37 | 38 | const openChangelog = async () => { |
| 39 | + if (isHandlingChangelog) return; |
| 40 | + isHandlingChangelog = true; |
38 | 41 | const { showChangelogs: show, lastVersion: version } = await getFromStorage({ showChangelogs: true, lastVersion: '-1' }); |
39 | 42 | 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) |
41 | 45 | openOptions(false, 'show-changelogs'); |
| 46 | + await setToStorage({ lastVersion: actualVersion }); |
| 47 | + isHandlingChangelog = false; |
42 | 48 | }; |
43 | 49 |
|
44 | 50 | const loadCreators = (() => { |
|
0 commit comments