Skip to content

Commit

Permalink
Add comment explaining isInitialized step
Browse files Browse the repository at this point in the history
  • Loading branch information
Gudahtt committed Nov 21, 2022
1 parent bca4d76 commit 1e51ecb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/scripts/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,16 @@ let connectRemote;
let connectExternal;

browser.runtime.onConnect.addListener(async (...args) => {
// queue up connection attempts here, waiting until after initialization
await isInitialized;

// This is set in `setupController`, which is called as part of initialization
connectRemote(...args);
});
browser.runtime.onConnectExternal.addListener(async (...args) => {
// queue up connection attempts here, waiting until after initialization
await isInitialized;

// This is set in `setupController`, which is called as part of initialization
connectExternal(...args);
});
Expand Down

0 comments on commit 1e51ecb

Please sign in to comment.