From 4f1171b738dc7fd4e5f393223e10a8cef7749968 Mon Sep 17 00:00:00 2001 From: turbocrime <134443988+turbocrime@users.noreply.github.com> Date: Fri, 15 Mar 2024 11:47:25 -0700 Subject: [PATCH] don't attempt to onboard at services init (#774) hotfix focus stealing bug --- apps/extension/src/service-worker.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/apps/extension/src/service-worker.ts b/apps/extension/src/service-worker.ts index be6d37dff9..6b65030253 100644 --- a/apps/extension/src/service-worker.ts +++ b/apps/extension/src/service-worker.ts @@ -37,19 +37,17 @@ import { approveTransaction } from './approve-transaction'; import { rpcImpls } from './impls'; import { backOff } from 'exponential-backoff'; -// prevent spamming the focus-stealing openOptionsPage -let openOptionsOnce: undefined | Promise; const startServices = async () => { const grpcEndpoint = await localExtStorage.get('grpcEndpoint'); const wallet0 = (await localExtStorage.get('wallets'))[0]; - if (!wallet0) openOptionsOnce ??= chrome.runtime.openOptionsPage(); + if (!wallet0) throw new Error('No wallet found'); const services = new Services({ idbVersion: IDB_VERSION, grpcEndpoint, - walletId: wallet0?.id, - fullViewingKey: wallet0?.fullViewingKey, + walletId: wallet0.id, + fullViewingKey: wallet0.fullViewingKey, }); await services.initialize(); return services;