mirror of
https://github.com/huhu/rust-search-extension
synced 2024-11-14 23:57:07 +00:00
Start extension after all index has been updated
This commit is contained in:
parent
fe3a501251
commit
72c2a94787
1 changed files with 5 additions and 3 deletions
|
@ -11,7 +11,7 @@ function getPlatformOs() {
|
|||
});
|
||||
}
|
||||
|
||||
(async () => {
|
||||
async function start() {
|
||||
// All dynamic setting items. Those items will been updated
|
||||
// in chrome.storage.onchange listener callback.
|
||||
let isOfflineMode = await settings.isOfflineMode;
|
||||
|
@ -536,7 +536,7 @@ function getPlatformOs() {
|
|||
}
|
||||
return true;
|
||||
});
|
||||
})();
|
||||
}
|
||||
|
||||
const chromeAction = chrome.action || chrome.browserAction;
|
||||
chromeAction.onClicked.addListener(() => {
|
||||
|
@ -544,9 +544,11 @@ chromeAction.onClicked.addListener(() => {
|
|||
chrome.tabs.create({ url: managePage });
|
||||
});
|
||||
|
||||
chrome.runtime.onInstalled.addListener(({ previousVersion, reason }) => {
|
||||
chrome.runtime.onInstalled.addListener(async ({ previousVersion, reason }) => {
|
||||
if (reason === "update" && previousVersion !== manifest.version) {
|
||||
IndexManager.updateAllIndex();
|
||||
console.log(`New version updated! Previous version: ${previousVersion}, new version: ${manifest.version}`);
|
||||
}
|
||||
|
||||
await start()
|
||||
});
|
Loading…
Reference in a new issue