diff --git a/src/background/announcements.ts b/src/background/announcements.ts index 9888d4e..e3a4ba1 100644 --- a/src/background/announcements.ts +++ b/src/background/announcements.ts @@ -5,13 +5,16 @@ const getAnnouncements = async (): Promise> => { return announcements; }; -const addAnnouncement = async (announcement: string): Promise => { +const addAnnouncement = async ( + announcement: string, + isActive: boolean +): Promise => { const announcements = await getAnnouncements(); if (announcement in announcements) { return; } await chrome.storage.local.set({ - [KEY]: { ...announcements, [announcement]: true }, + [KEY]: { ...announcements, [announcement]: isActive }, }); }; diff --git a/src/background/index.ts b/src/background/index.ts index 8401113..91ef7be 100644 --- a/src/background/index.ts +++ b/src/background/index.ts @@ -26,10 +26,10 @@ const extensionInitialization = initialize(registeredUrls); chrome.runtime.onInstalled.addListener(async ({ reason }) => { await extensionInitialization; - if (reason !== "update") { + if (reason !== "install" && reason !== "update") { return; } - await addAnnouncement("custom-domains"); + await addAnnouncement("custom-domains", reason === "update"); await refreshIcon(); });