From 4f0286a3c32afda2dbc22238c78ff13f23d8a9b2 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Mon, 2 Mar 2026 12:22:12 -0600 Subject: [PATCH] Validate timezones before render and update changelog --- CHANGELOG.md | 2 ++ .../components/user-profile/UserRoomProfile.tsx | 17 +++++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be5e499a..2a0a7a54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ - Add validation to timezones before rendering. - Fix invalid matrix.to event link generation ([cinnyapp#2717](https://github.com/cinnyapp/cinny/pull/2717)) - [tulir](https://github.com/tulir) +- Fix Call Rooms' chat button ([#58](https://github.com/7w1/sable/pull/58)) - [Rosy-iso](https://github.com/Rosy-iso) +- Strip quotes for mxc urls converted to http for tuwunel ([#56](https://github.com/7w1/sable/pull/56)) - [Rosy-iso](https://github.com/Rosy-iso) ## 1.2.3 - 3/2/2026 diff --git a/src/app/components/user-profile/UserRoomProfile.tsx b/src/app/components/user-profile/UserRoomProfile.tsx index 6a9682bc..eefb449d 100644 --- a/src/app/components/user-profile/UserRoomProfile.tsx +++ b/src/app/components/user-profile/UserRoomProfile.tsx @@ -74,14 +74,19 @@ function UserExtendedSection({ }; const pronouns = profile.pronouns?.map((p: any) => clamp(p.summary, 16)).join(', '); - const timezone = profile.timezone ? clamp(profile.timezone, 64) : null; - const localTime = timezone - ? new Intl.DateTimeFormat([], { + const localTime = useMemo(() => { + if (!profile.timezone) return null; + + try { + return new Intl.DateTimeFormat([], { hour: 'numeric', minute: '2-digit', - timeZone: timezone, - }).format(new Date()) - : null; + timeZone: profile.timezone, + }).format(new Date()); + } catch { + return null; + } + }, [profile.timezone]); const bioContent = useMemo(() => { let rawBio =