Skip to content

Commit d35d317

Browse files
committed
fix(native-bridge): wait for hello handshake before returning enable status
1 parent 0c1817b commit d35d317

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/entries/background/utils/nativeMessaging.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,10 @@ onMessage("nativeBridgeGetStatus", async () => {
278278
onMessage("nativeBridgeSetEnabled", async ({ data }) => {
279279
await chrome.storage.local.set({ [ENABLED_KEY]: data });
280280
await init();
281+
// Brief wait for the async hello handshake to complete
282+
if (state === "connecting") {
283+
await new Promise((r) => setTimeout(r, 200));
284+
}
281285
return getStatus();
282286
});
283287

0 commit comments

Comments
 (0)