From 43d8ad0cf28d4a15e66bc968c32c849ae544e1c6 Mon Sep 17 00:00:00 2001 From: S2kael Date: Wed, 16 Oct 2024 17:24:56 +0700 Subject: [PATCH] [Issue-3759] Fix cannot run on firefox --- .../extension-base/src/services/mkt-campaign-service/index.ts | 1 + packages/extension-koni/src/background.ts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/extension-base/src/services/mkt-campaign-service/index.ts b/packages/extension-base/src/services/mkt-campaign-service/index.ts index 544b44c174..44493db266 100644 --- a/packages/extension-base/src/services/mkt-campaign-service/index.ts +++ b/packages/extension-base/src/services/mkt-campaign-service/index.ts @@ -102,6 +102,7 @@ export default class MktCampaignService { } public async handleMktCampaignData (data: T[]): Promise { + await this.#state.eventService.waitAccountReady; const addresses = keyring.getPairs().map((pair) => pair.address); const allConditions: Record = this.getAllConditions(data); const conditionBalanceMap = await this.checkBalanceCondition(allConditions, addresses); diff --git a/packages/extension-koni/src/background.ts b/packages/extension-koni/src/background.ts index 08169ae09d..68748fb851 100644 --- a/packages/extension-koni/src/background.ts +++ b/packages/extension-koni/src/background.ts @@ -17,7 +17,9 @@ const actionHandler = ActionHandler.instance; actionHandler.setHandler(SWHandler.instance); -globalThis.window = globalThis.self; +if (!globalThis.window) { + globalThis.window = globalThis.self; +} cryptoWaitReady() .then((): void => {