@logickernel/bridge 0.9.1 → 0.9.3
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/next/components.js
CHANGED
|
@@ -1312,6 +1312,9 @@ function AppSidebar({
|
|
|
1312
1312
|
});
|
|
1313
1313
|
React2.useEffect(() => {
|
|
1314
1314
|
if (process.env.NODE_ENV === "development") {
|
|
1315
|
+
const orgIds = apiOrganizations.map((org) => org.id);
|
|
1316
|
+
const pathOrgIdInList = pathOrgId ? apiOrganizations.some((org) => org.id === pathOrgId) : false;
|
|
1317
|
+
const computedCurrentOrgId = organizationId || (pathOrgId && (apiOrganizations.length === 0 || apiOrganizations.some((org) => org.id === pathOrgId)) ? pathOrgId : void 0) || (detectedOrgId && apiNavigationItems.length > 0 ? detectedOrgId : void 0);
|
|
1315
1318
|
console.log("[AppSidebar] Navigation state:", {
|
|
1316
1319
|
currentPathname,
|
|
1317
1320
|
pathOrgId,
|
|
@@ -1320,14 +1323,18 @@ function AppSidebar({
|
|
|
1320
1323
|
apiBaseUrl,
|
|
1321
1324
|
itemsCount: apiNavigationItems.length,
|
|
1322
1325
|
organizationsCount: apiOrganizations.length,
|
|
1326
|
+
organizationIds: orgIds,
|
|
1327
|
+
pathOrgIdInList,
|
|
1328
|
+
computedCurrentOrgId,
|
|
1329
|
+
displayItemsCount: computedCurrentOrgId ? apiNavigationItems.length : 0,
|
|
1323
1330
|
loading: navigationLoading,
|
|
1324
1331
|
error: navigationError?.message,
|
|
1325
1332
|
navigationUrl: detectedOrgId ? `${apiBaseUrl}/navigation/${detectedOrgId}` : "N/A"
|
|
1326
1333
|
});
|
|
1327
1334
|
}
|
|
1328
|
-
}, [currentPathname, pathOrgId, organizationId, detectedOrgId, apiBaseUrl, apiNavigationItems.length, apiOrganizations.length, navigationLoading, navigationError]);
|
|
1335
|
+
}, [currentPathname, pathOrgId, organizationId, detectedOrgId, apiBaseUrl, apiNavigationItems.length, apiOrganizations.length, navigationLoading, navigationError, apiOrganizations, apiNavigationItems]);
|
|
1329
1336
|
const user = navigationUser || userProp;
|
|
1330
|
-
const currentOrgId = organizationId || (pathOrgId && apiOrganizations.some((org) => org.id === pathOrgId) ? pathOrgId : void 0);
|
|
1337
|
+
const currentOrgId = organizationId || (pathOrgId && (apiOrganizations.length === 0 || apiOrganizations.some((org) => org.id === pathOrgId)) ? pathOrgId : void 0) || (detectedOrgId && apiNavigationItems.length > 0 ? detectedOrgId : void 0);
|
|
1331
1338
|
let navigationItems = apiNavigationItems;
|
|
1332
1339
|
if (currentOrgId && navigationItems.length > 0) {
|
|
1333
1340
|
navigationItems = navigationItems.map((item) => ({
|