@logickernel/bridge 0.11.2 → 0.11.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.
@@ -1125,22 +1125,23 @@ function TeamSwitcher({
1125
1125
  const isMobile = sidebar?.isMobile ?? false;
1126
1126
  const pathname = navigation.usePathname();
1127
1127
  const router = navigation.useRouter();
1128
- const pathSegments = pathname.split("/");
1129
- const isAppOrgRoute = pathname.startsWith("/app/") && pathSegments.length > 2 && pathSegments[2] !== "user";
1130
- const pathOrgId = isAppOrgRoute ? pathSegments[2] : null;
1128
+ const pathSegments = pathname.split("/").filter(Boolean);
1129
+ const skipSegments = ["user", "api", "auth", "dashboard", "settings", "app"];
1130
+ const potentialOrgId = pathSegments.length >= 1 ? pathSegments[0] : null;
1131
+ const pathOrgId = potentialOrgId && !skipSegments.includes(potentialOrgId) && (potentialOrgId.includes("-") || potentialOrgId.length >= 8) ? potentialOrgId : null;
1131
1132
  const currentOrgId = organizationId || (pathOrgId && teams.some((team) => team.id === pathOrgId) ? pathOrgId : null);
1132
1133
  const handleTeamChange = (teamId) => {
1133
1134
  if (isMobile && sidebar?.setOpenMobile) {
1134
1135
  sidebar.setOpenMobile(false);
1135
1136
  }
1136
- router.push(`/app/${teamId}/home`);
1137
+ router.push(`/${teamId}/home`);
1137
1138
  router.refresh();
1138
1139
  };
1139
1140
  const handleManageOrganizations = () => {
1140
1141
  if (isMobile && sidebar?.setOpenMobile) {
1141
1142
  sidebar.setOpenMobile(false);
1142
1143
  }
1143
- router.push("/app/user/organizations");
1144
+ router.push("/user/organizations");
1144
1145
  };
1145
1146
  const teamsWithLogo = teams.map((org) => {
1146
1147
  const logoIcon = org.logo ? getIconComponent(org.logo) : LucideIcons.GalleryVerticalEnd;
@@ -1318,12 +1319,7 @@ function AppSidebar({
1318
1319
  const currentPathname = navigation.usePathname();
1319
1320
  const pathSegments = currentPathname.split("/").filter(Boolean);
1320
1321
  let pathOrgId = null;
1321
- if (pathSegments.length >= 2 && pathSegments[0] === "app") {
1322
- const potentialOrgId = pathSegments[1];
1323
- if (potentialOrgId && potentialOrgId !== "user") {
1324
- pathOrgId = potentialOrgId;
1325
- }
1326
- } else if (pathSegments.length >= 1) {
1322
+ if (pathSegments.length >= 1) {
1327
1323
  const potentialOrgId = pathSegments[0];
1328
1324
  const skipSegments = ["user", "api", "auth", "dashboard", "settings", "app"];
1329
1325
  if (potentialOrgId && !skipSegments.includes(potentialOrgId)) {