@the-portland-company/shell 0.76.10 → 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.
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { broadcastLogout, watchLogout } from './chunk-LL6LSJAH.js';
3
- import { clearBetaBannerDismissal, standardPolitogyNav, standardNavIcons, isNavItemActive, NavAppShell, NavChromeProvider, TopBarWidgetSlot, FuelAction, SpecOverlayAction, NotificationsAction, SupportAction, useChromeMe, useThemePreference, useNavChromeDedupedFetch, useChromeOrgs, useNavChromeFetcher } from './chunk-ZWGCO2EP.js';
4
- export { standardNavIcons } from './chunk-ZWGCO2EP.js';
3
+ import { clearBetaBannerDismissal, standardPolitogyNav, standardNavIcons, isNavItemActive, NavAppShell, NavChromeProvider, TopBarWidgetSlot, FuelAction, SpecOverlayAction, NotificationsAction, SupportAction, useChromeMe, useThemePreference, useNavChromeDedupedFetch, useChromeOrgs, useNavChromeFetcher } from './chunk-34NXDWIS.js';
4
+ export { standardNavIcons } from './chunk-34NXDWIS.js';
5
5
  import { warnDeprecated } from './chunk-MY6G3LMN.js';
6
6
  import './chunk-BHRVZPZ7.js';
7
7
  import { NAV_DISPLAY_DEFAULT, resolveNavDisplay, writeNavDisplayLocal, writeNavDisplayCookie, isNavDisplayPreference, NAV_DISPLAY_STORAGE_KEY, readNavDisplayCookie } from './chunk-7YVJ7HQG.js';
@@ -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,