Skip to content

Commit

Permalink
don't attempt to onboard at services init (#774)
Browse files Browse the repository at this point in the history
hotfix focus stealing bug
  • Loading branch information
turbocrime authored Mar 15, 2024
1 parent 2d92fd7 commit 4f1171b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions apps/extension/src/service-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void>;
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;
Expand Down

0 comments on commit 4f1171b

Please sign in to comment.