@cupcodev/ui 1.2.4 → 1.2.51

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/index.cjs CHANGED
@@ -22829,7 +22829,7 @@ var MainNavbar = ({
22829
22829
  ctaHref = "/login",
22830
22830
  pathname,
22831
22831
  onNavigate,
22832
- authStatus = "unauthenticated",
22832
+ authStatus,
22833
22833
  authUser,
22834
22834
  presenceStatus,
22835
22835
  onPresenceStatusChange,
@@ -22880,7 +22880,14 @@ var MainNavbar = ({
22880
22880
  }, []);
22881
22881
  const resolvedProfileAvatarUrl = (_b5 = (_a65 = resolveChatAvatarUrl(persistedProfileAvatarValue)) != null ? _a65 : authUser == null ? void 0 : authUser.picture) != null ? _b5 : void 0;
22882
22882
  const effectiveCurrentUserId = resolvedSenderId != null ? resolvedSenderId : currentUserId;
22883
- const isAuthenticated = authStatus === "authenticated";
22883
+ const resolvedAuthStatus = (0, import_react19.useMemo)(() => {
22884
+ if (authStatus) return authStatus;
22885
+ if ((authUser == null ? void 0 : authUser.sub) || (authUser == null ? void 0 : authUser.email)) {
22886
+ return "authenticated";
22887
+ }
22888
+ return "unauthenticated";
22889
+ }, [authStatus, authUser == null ? void 0 : authUser.email, authUser == null ? void 0 : authUser.sub]);
22890
+ const isAuthenticated = resolvedAuthStatus === "authenticated";
22884
22891
  (0, import_react19.useEffect)(() => {
22885
22892
  if (!isAuthenticated) {
22886
22893
  setResolvedSenderId(null);
@@ -24241,8 +24248,8 @@ var MainNavbar = ({
24241
24248
  actions: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
24242
24249
  UserMenuCupcode,
24243
24250
  {
24244
- isAuthenticated: authStatus === "authenticated",
24245
- isLoading: authStatus === "loading",
24251
+ isAuthenticated: resolvedAuthStatus === "authenticated",
24252
+ isLoading: resolvedAuthStatus === "loading",
24246
24253
  loginLabel: ctaLabel,
24247
24254
  displayName: authUser == null ? void 0 : authUser.name,
24248
24255
  username: (_c = authUser == null ? void 0 : authUser.preferredUsername) != null ? _c : authUser == null ? void 0 : authUser.nickname,
package/dist/index.js CHANGED
@@ -22488,7 +22488,7 @@ var MainNavbar = ({
22488
22488
  ctaHref = "/login",
22489
22489
  pathname,
22490
22490
  onNavigate,
22491
- authStatus = "unauthenticated",
22491
+ authStatus,
22492
22492
  authUser,
22493
22493
  presenceStatus,
22494
22494
  onPresenceStatusChange,
@@ -22539,7 +22539,14 @@ var MainNavbar = ({
22539
22539
  }, []);
22540
22540
  const resolvedProfileAvatarUrl = (_b5 = (_a65 = resolveChatAvatarUrl(persistedProfileAvatarValue)) != null ? _a65 : authUser == null ? void 0 : authUser.picture) != null ? _b5 : void 0;
22541
22541
  const effectiveCurrentUserId = resolvedSenderId != null ? resolvedSenderId : currentUserId;
22542
- const isAuthenticated = authStatus === "authenticated";
22542
+ const resolvedAuthStatus = useMemo8(() => {
22543
+ if (authStatus) return authStatus;
22544
+ if ((authUser == null ? void 0 : authUser.sub) || (authUser == null ? void 0 : authUser.email)) {
22545
+ return "authenticated";
22546
+ }
22547
+ return "unauthenticated";
22548
+ }, [authStatus, authUser == null ? void 0 : authUser.email, authUser == null ? void 0 : authUser.sub]);
22549
+ const isAuthenticated = resolvedAuthStatus === "authenticated";
22543
22550
  useEffect16(() => {
22544
22551
  if (!isAuthenticated) {
22545
22552
  setResolvedSenderId(null);
@@ -23900,8 +23907,8 @@ var MainNavbar = ({
23900
23907
  actions: /* @__PURE__ */ jsx45("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsx45(
23901
23908
  UserMenuCupcode,
23902
23909
  {
23903
- isAuthenticated: authStatus === "authenticated",
23904
- isLoading: authStatus === "loading",
23910
+ isAuthenticated: resolvedAuthStatus === "authenticated",
23911
+ isLoading: resolvedAuthStatus === "loading",
23905
23912
  loginLabel: ctaLabel,
23906
23913
  displayName: authUser == null ? void 0 : authUser.name,
23907
23914
  username: (_c = authUser == null ? void 0 : authUser.preferredUsername) != null ? _c : authUser == null ? void 0 : authUser.nickname,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cupcodev/ui",
3
3
  "private": false,
4
- "version": "1.2.4",
4
+ "version": "1.2.51",
5
5
  "packageManager": "pnpm@10.28.2+sha512.41872f037ad22f7348e3b1debbaf7e867cfd448f2726d9cf74c08f19507c31d2c8e7a11525b983febc2df640b5438dee6023ebb1f84ed43cc2d654d2bc326264",
6
6
  "type": "module",
7
7
  "main": "./dist/index.cjs",