Skip to content

Commit

Permalink
fix: visibilitychange
Browse files Browse the repository at this point in the history
  • Loading branch information
gronxb committed Jun 19, 2024
1 parent 0fd1413 commit 1f7f29d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/web/src/internal/linkBridgeStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ export const linkBridgeStore = <
setState(data);
});

document.addEventListener("visibilitychange", () => {
if (document.visibilityState === "visible") {
window.ReactNativeWebView?.postMessage(
JSON.stringify({
type: "getBridgeState",
}),
);
}
});

window.ReactNativeWebView?.postMessage(
JSON.stringify({
type: "getBridgeState",
Expand Down

0 comments on commit 1f7f29d

Please sign in to comment.