@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.
package/dist/next/components.js
CHANGED
|
@@ -1096,22 +1096,23 @@ function TeamSwitcher({
|
|
|
1096
1096
|
const isMobile = sidebar?.isMobile ?? false;
|
|
1097
1097
|
const pathname = usePathname();
|
|
1098
1098
|
const router = useRouter();
|
|
1099
|
-
const pathSegments = pathname.split("/");
|
|
1100
|
-
const
|
|
1101
|
-
const
|
|
1099
|
+
const pathSegments = pathname.split("/").filter(Boolean);
|
|
1100
|
+
const skipSegments = ["user", "api", "auth", "dashboard", "settings", "app"];
|
|
1101
|
+
const potentialOrgId = pathSegments.length >= 1 ? pathSegments[0] : null;
|
|
1102
|
+
const pathOrgId = potentialOrgId && !skipSegments.includes(potentialOrgId) && (potentialOrgId.includes("-") || potentialOrgId.length >= 8) ? potentialOrgId : null;
|
|
1102
1103
|
const currentOrgId = organizationId || (pathOrgId && teams.some((team) => team.id === pathOrgId) ? pathOrgId : null);
|
|
1103
1104
|
const handleTeamChange = (teamId) => {
|
|
1104
1105
|
if (isMobile && sidebar?.setOpenMobile) {
|
|
1105
1106
|
sidebar.setOpenMobile(false);
|
|
1106
1107
|
}
|
|
1107
|
-
router.push(
|
|
1108
|
+
router.push(`/${teamId}/home`);
|
|
1108
1109
|
router.refresh();
|
|
1109
1110
|
};
|
|
1110
1111
|
const handleManageOrganizations = () => {
|
|
1111
1112
|
if (isMobile && sidebar?.setOpenMobile) {
|
|
1112
1113
|
sidebar.setOpenMobile(false);
|
|
1113
1114
|
}
|
|
1114
|
-
router.push("/
|
|
1115
|
+
router.push("/user/organizations");
|
|
1115
1116
|
};
|
|
1116
1117
|
const teamsWithLogo = teams.map((org) => {
|
|
1117
1118
|
const logoIcon = org.logo ? getIconComponent(org.logo) : GalleryVerticalEnd;
|
|
@@ -1289,12 +1290,7 @@ function AppSidebar({
|
|
|
1289
1290
|
const currentPathname = usePathname();
|
|
1290
1291
|
const pathSegments = currentPathname.split("/").filter(Boolean);
|
|
1291
1292
|
let pathOrgId = null;
|
|
1292
|
-
if (pathSegments.length >=
|
|
1293
|
-
const potentialOrgId = pathSegments[1];
|
|
1294
|
-
if (potentialOrgId && potentialOrgId !== "user") {
|
|
1295
|
-
pathOrgId = potentialOrgId;
|
|
1296
|
-
}
|
|
1297
|
-
} else if (pathSegments.length >= 1) {
|
|
1293
|
+
if (pathSegments.length >= 1) {
|
|
1298
1294
|
const potentialOrgId = pathSegments[0];
|
|
1299
1295
|
const skipSegments = ["user", "api", "auth", "dashboard", "settings", "app"];
|
|
1300
1296
|
if (potentialOrgId && !skipSegments.includes(potentialOrgId)) {
|