@logickernel/bridge 0.9.1 → 0.9.2
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.cjs
CHANGED
|
@@ -1341,6 +1341,9 @@ function AppSidebar({
|
|
|
1341
1341
|
});
|
|
1342
1342
|
React2__namespace.useEffect(() => {
|
|
1343
1343
|
if (process.env.NODE_ENV === "development") {
|
|
1344
|
+
const orgIds = apiOrganizations.map((org) => org.id);
|
|
1345
|
+
const pathOrgIdInList = pathOrgId ? apiOrganizations.some((org) => org.id === pathOrgId) : false;
|
|
1346
|
+
const computedCurrentOrgId = organizationId || (pathOrgId && pathOrgIdInList ? pathOrgId : void 0);
|
|
1344
1347
|
console.log("[AppSidebar] Navigation state:", {
|
|
1345
1348
|
currentPathname,
|
|
1346
1349
|
pathOrgId,
|
|
@@ -1349,14 +1352,18 @@ function AppSidebar({
|
|
|
1349
1352
|
apiBaseUrl,
|
|
1350
1353
|
itemsCount: apiNavigationItems.length,
|
|
1351
1354
|
organizationsCount: apiOrganizations.length,
|
|
1355
|
+
organizationIds: orgIds,
|
|
1356
|
+
pathOrgIdInList,
|
|
1357
|
+
computedCurrentOrgId,
|
|
1358
|
+
displayItemsCount: computedCurrentOrgId ? apiNavigationItems.length : 0,
|
|
1352
1359
|
loading: navigationLoading,
|
|
1353
1360
|
error: navigationError?.message,
|
|
1354
1361
|
navigationUrl: detectedOrgId ? `${apiBaseUrl}/navigation/${detectedOrgId}` : "N/A"
|
|
1355
1362
|
});
|
|
1356
1363
|
}
|
|
1357
|
-
}, [currentPathname, pathOrgId, organizationId, detectedOrgId, apiBaseUrl, apiNavigationItems.length, apiOrganizations.length, navigationLoading, navigationError]);
|
|
1364
|
+
}, [currentPathname, pathOrgId, organizationId, detectedOrgId, apiBaseUrl, apiNavigationItems.length, apiOrganizations.length, navigationLoading, navigationError, apiOrganizations, apiNavigationItems]);
|
|
1358
1365
|
const user = navigationUser || userProp;
|
|
1359
|
-
const currentOrgId = organizationId || (pathOrgId && apiOrganizations.some((org) => org.id === pathOrgId) ? pathOrgId : void 0);
|
|
1366
|
+
const currentOrgId = organizationId || (pathOrgId && (apiOrganizations.length === 0 || apiOrganizations.some((org) => org.id === pathOrgId)) ? pathOrgId : void 0) || (detectedOrgId && apiNavigationItems.length > 0 ? detectedOrgId : void 0);
|
|
1360
1367
|
let navigationItems = apiNavigationItems;
|
|
1361
1368
|
if (currentOrgId && navigationItems.length > 0) {
|
|
1362
1369
|
navigationItems = navigationItems.map((item) => ({
|