From 690800ccaa65a7d0af2e2ade6e003a1f81c4e427 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 26 Feb 2026 19:23:46 -0600 Subject: [PATCH] Fix font comparison to use family name only, ignoring CDN URL added at publish time --- src/pages/ProfilePage.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pages/ProfilePage.tsx b/src/pages/ProfilePage.tsx index b992f3be..414905dc 100644 --- a/src/pages/ProfilePage.tsx +++ b/src/pages/ProfilePage.tsx @@ -757,14 +757,17 @@ export function ProfilePage() { // Detect whether the app custom theme differs from the published profile theme. // Colors are compared via hex to avoid HSL precision issues from the hex round-trip. + // Fonts are compared by family name only, since the URL is resolved to a CDN URL at + // publish time and won't match the local config which omits it for bundled fonts. const colorsToHex = (c: CoreThemeColors) => `${hslStringToHex(c.primary)}${hslStringToHex(c.text)}${hslStringToHex(c.background)}`; + const fontFamily = (f?: { family: string }) => f?.family ?? ''; const ownCustomThemeSnapshot = ownCustomTheme - ? colorsToHex(ownCustomTheme.colors) + JSON.stringify(ownCustomTheme.font ?? '') + JSON.stringify(ownCustomTheme.background ?? '') + ? colorsToHex(ownCustomTheme.colors) + fontFamily(ownCustomTheme.font) + JSON.stringify(ownCustomTheme.background ?? '') : null; const profileThemeDiffers = profileHasTheme && ownCustomThemeSnapshot && profileTheme && ownCustomTheme ? (colorsToHex(profileTheme.colors) !== colorsToHex(ownCustomTheme.colors) - || JSON.stringify(profileTheme.font ?? '') !== JSON.stringify(ownCustomTheme.font ?? '') + || fontFamily(profileTheme.font) !== fontFamily(ownCustomTheme.font) || JSON.stringify(profileTheme.background ?? '') !== JSON.stringify(ownCustomTheme.background ?? '')) : false;