@the-portland-company/shell 0.43.0 → 0.43.1
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 +8 -4
- package/dist/app-chrome.cjs.map +1 -1
- package/dist/app-chrome.js +8 -4
- package/dist/app-chrome.js.map +1 -1
- package/package.json +1 -1
package/dist/app-chrome.cjs
CHANGED
|
@@ -3156,10 +3156,14 @@ function ChromeStateProvider({
|
|
|
3156
3156
|
orgReconciled.current = true;
|
|
3157
3157
|
return;
|
|
3158
3158
|
}
|
|
3159
|
-
if (
|
|
3159
|
+
if (!orgs && !orgsError) return;
|
|
3160
3160
|
orgReconciled.current = true;
|
|
3161
|
-
|
|
3162
|
-
|
|
3161
|
+
const members = [...orgs ?? [], ...controlledOrg?.orgs ?? []];
|
|
3162
|
+
if (!members.some((o) => o.id === pref)) return;
|
|
3163
|
+
const controlled = controlledOrgRef.current;
|
|
3164
|
+
if (controlled) (controlled.onExternalSwitch ?? controlled.onSwitch)(pref);
|
|
3165
|
+
else setOrgIdState(pref);
|
|
3166
|
+
}, [chromeMe.me, orgs, orgsError, controlledOrg]);
|
|
3163
3167
|
const setOrgId = react.useCallback((id) => {
|
|
3164
3168
|
setOrgIdState(id);
|
|
3165
3169
|
try {
|
|
@@ -3238,7 +3242,7 @@ function ChromeStateProvider({
|
|
|
3238
3242
|
} catch {
|
|
3239
3243
|
}
|
|
3240
3244
|
const known = chromeMe.me?.activeOrg ?? null;
|
|
3241
|
-
if (chromeMe.me && activeOrgId !== known && activeOrgId !== lastPatchedOrg.current) {
|
|
3245
|
+
if (orgReconciled.current && chromeMe.me && activeOrgId !== known && activeOrgId !== lastPatchedOrg.current) {
|
|
3242
3246
|
lastPatchedOrg.current = activeOrgId;
|
|
3243
3247
|
chromeFetch?.("me/preferences", {
|
|
3244
3248
|
method: "PATCH",
|