From 2bbd390a3b639089c3ef2cd56b1a294f943124a4 Mon Sep 17 00:00:00 2001 From: "nathan.vititoe" Date: Sun, 2 Aug 2026 16:35:11 -0400 Subject: [PATCH] image path changes, for dev setup, needs testing on 'prod' --- src/app/features/settings/about/About.tsx | 3 ++- src/app/pages/auth/AuthLayout.tsx | 3 ++- src/app/pages/auth/oidc/oidcConfig.ts | 2 +- src/app/pages/client/ClientNonUIFeatures.tsx | 8 ++++---- src/app/pages/client/WelcomePage.tsx | 3 ++- vite.config.js | 2 +- 6 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/app/features/settings/about/About.tsx b/src/app/features/settings/about/About.tsx index 0ecf98452..ec1d4da61 100644 --- a/src/app/features/settings/about/About.tsx +++ b/src/app/features/settings/about/About.tsx @@ -4,10 +4,11 @@ import { Page, PageContent, PageHeader } from '../../../components/page'; import { SequenceCard } from '../../../components/sequence-card'; import { SequenceCardStyle } from '../styles.css'; import { SettingTile } from '../../../components/setting-tile'; -import LotusLogo from '../../../../../public/res/Lotus.png'; import pkg from '../../../../../package.json'; import { clearCacheAndReload } from '../../../../client/initMatrix'; import { useMatrixClient } from '../../../hooks/useMatrixClient'; +import { getOriginBaseUrl, withOriginBaseUrl } from '../../../pages/pathUtils'; +const LotusLogo = withOriginBaseUrl(getOriginBaseUrl(), '/Lotus.png'); type MSC1929Contact = { matrix_id?: string; diff --git a/src/app/pages/auth/AuthLayout.tsx b/src/app/pages/auth/AuthLayout.tsx index b78856011..2641ba07a 100644 --- a/src/app/pages/auth/AuthLayout.tsx +++ b/src/app/pages/auth/AuthLayout.tsx @@ -20,7 +20,6 @@ import { } from '../../hooks/useClientConfig'; import { AsyncStatus, useAsyncCallback } from '../../hooks/useAsyncCallback'; import { LOGIN_PATH, REGISTER_PATH, RESET_PASSWORD_PATH } from '../paths'; -import LotusLogo from '../../../../public/res/Lotus.png'; import { ServerPicker } from './ServerPicker'; import { AutoDiscoveryAction, autoDiscovery } from '../../cs-api'; import { SpecVersionsLoader } from '../../components/SpecVersionsLoader'; @@ -30,6 +29,8 @@ import { AuthFlowsLoader } from '../../components/AuthFlowsLoader'; import { AuthFlowsProvider } from '../../hooks/useAuthFlows'; import { AuthServerProvider } from '../../hooks/useAuthServer'; import { tryDecodeURIComponent } from '../../utils/dom'; +import { getOriginBaseUrl, withOriginBaseUrl } from '../pathUtils'; +const LotusLogo = withOriginBaseUrl(getOriginBaseUrl() ,'/Lotus.png'); const currentAuthPath = (pathname: string): string => { if (matchPath(LOGIN_PATH, pathname)) { diff --git a/src/app/pages/auth/oidc/oidcConfig.ts b/src/app/pages/auth/oidc/oidcConfig.ts index 015c25f33..b046ec150 100644 --- a/src/app/pages/auth/oidc/oidcConfig.ts +++ b/src/app/pages/auth/oidc/oidcConfig.ts @@ -1,7 +1,7 @@ import type { OidcRegistrationClientMetadata } from 'matrix-js-sdk'; -import LotusLogo from '../../../../../public/res/Lotus.png'; import { OIDC_CALLBACK_PATH } from '../../paths'; import { getOriginBaseUrl, withOriginBaseUrl } from '../../pathUtils'; +const LotusLogo = withOriginBaseUrl(getOriginBaseUrl() ,'/Lotus.png'); /** * Absolute URL the OIDC provider redirects back to after authorization. diff --git a/src/app/pages/client/ClientNonUIFeatures.tsx b/src/app/pages/client/ClientNonUIFeatures.tsx index e14a1141c..69e682773 100644 --- a/src/app/pages/client/ClientNonUIFeatures.tsx +++ b/src/app/pages/client/ClientNonUIFeatures.tsx @@ -17,9 +17,6 @@ import { manualDndAtom } from '../../state/manualDnd'; import { isSnoozeActive, notificationSnoozeUntilAtom } from '../../state/notificationSnooze'; import { isWithinTimeWindow } from '../../utils/timeWindow'; import { roomToUnreadAtom } from '../../state/room/roomToUnread'; -import LogoSVG from '../../../../public/res/lotus.png'; -import LogoUnreadSVG from '../../../../public/res/lotus-unread.png'; -import LogoHighlightSVG from '../../../../public/res/lotus-highlight.png'; import NotificationSound from '../../../../public/sound/notification.ogg'; import InviteSound from '../../../../public/sound/invite.ogg'; import { notificationPermission, setFavicon, showOsNotification } from '../../utils/dom'; @@ -29,7 +26,7 @@ import { settingsAtom } from '../../state/settings'; import { allInvitesAtom } from '../../state/room-list/inviteList'; import { useMatrixClient } from '../../hooks/useMatrixClient'; import { useHydrateMsgDrafts } from '../../hooks/useHydrateMsgDrafts'; -import { getDirectRoomPath, getHomeRoomPath, getInboxInvitesPath } from '../pathUtils'; +import { getDirectRoomPath, getHomeRoomPath, getInboxInvitesPath, getOriginBaseUrl, withOriginBaseUrl } from '../pathUtils'; import { mDirectAtom } from '../../state/mDirectList'; import { getMemberName, @@ -66,6 +63,9 @@ import { shouldNotifyThreadReply, THREAD_NOTIFICATIONS_FALLBACK_BEHAVIOR, } from '../../utils/threadNotifications'; +const LogoSVG = withOriginBaseUrl(getOriginBaseUrl() ,'/lotus.png'); +const LogoUnreadSVG = withOriginBaseUrl(getOriginBaseUrl() ,'/lotus-unread.png') +const LogoHighlightSVG = withOriginBaseUrl(getOriginBaseUrl() ,'/lotus-highlight.png'); // Grace period after the initial sync settles before invite notifications arm, so // the async invite-atom population lands first and isn't mistaken for new invites. diff --git a/src/app/pages/client/WelcomePage.tsx b/src/app/pages/client/WelcomePage.tsx index aec27b98c..b807501aa 100644 --- a/src/app/pages/client/WelcomePage.tsx +++ b/src/app/pages/client/WelcomePage.tsx @@ -1,8 +1,9 @@ import React from 'react'; import { Box, Button, Icon, Icons, Text, config, toRem } from 'folds'; import { Page, PageHero, PageHeroSection } from '../../components/page'; -import LotusLogo from '../../../../public/res/Lotus.png'; import pkg from '../../../../package.json'; +import { getOriginBaseUrl, withOriginBaseUrl } from '../pathUtils'; +const LotusLogo = withOriginBaseUrl(getOriginBaseUrl() ,'/Lotus.png'); export function WelcomePage() { return ( diff --git a/vite.config.js b/vite.config.js index faa37921d..235d3190c 100644 --- a/vite.config.js +++ b/vite.config.js @@ -246,7 +246,7 @@ const vendorChunks = (id) => { export default defineConfig({ appType: 'spa', - publicDir: false, + publicDir: './public/res', base: buildConfig.base, server: { port: 8080,