@the-portland-company/shell 0.76.11 → 0.76.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app-chrome.cjs +18 -0
- package/dist/app-chrome.cjs.map +1 -1
- package/dist/app-chrome.js +18 -0
- package/dist/app-chrome.js.map +1 -1
- package/package.json +1 -1
package/dist/app-chrome.js
CHANGED
|
@@ -975,6 +975,24 @@ function TokenChromeStateProvider({
|
|
|
975
975
|
useEffect(() => {
|
|
976
976
|
if (isOrgId(tokenOrg.orgId) && !pendingOrg) writeActiveOrgCookie(tokenOrg.orgId);
|
|
977
977
|
}, [tokenOrg.orgId, pendingOrg]);
|
|
978
|
+
useEffect(() => {
|
|
979
|
+
const onWake = () => {
|
|
980
|
+
const cookieOrg = readActiveOrgCookie();
|
|
981
|
+
const current = tokenOrgRef.current;
|
|
982
|
+
if (!isOrgId(cookieOrg) || cookieOrg === (current.orgId ?? null)) return;
|
|
983
|
+
if (pendingOrg === cookieOrg) return;
|
|
984
|
+
void Promise.resolve(current.onReexchange(cookieOrg, { perTab: false })).catch(
|
|
985
|
+
() => {
|
|
986
|
+
}
|
|
987
|
+
);
|
|
988
|
+
};
|
|
989
|
+
window.addEventListener("focus", onWake);
|
|
990
|
+
document.addEventListener("visibilitychange", onWake);
|
|
991
|
+
return () => {
|
|
992
|
+
window.removeEventListener("focus", onWake);
|
|
993
|
+
document.removeEventListener("visibilitychange", onWake);
|
|
994
|
+
};
|
|
995
|
+
}, [pendingOrg]);
|
|
978
996
|
const value = useMemo(
|
|
979
997
|
() => ({
|
|
980
998
|
orgId,
|