mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
perf: preload theme button and background images on app startup
This commit is contained in:
@@ -3,6 +3,7 @@ import { Outlet, Route, Routes, useLocation, useParams } from 'react-router-dom'
|
||||
import { useAccountComment } from '@plebbit/plebbit-react-hooks';
|
||||
import { initSnow, removeSnow } from './lib/snow';
|
||||
import { isAllView, isModView, isSubscriptionsView } from './lib/utils/view-utils';
|
||||
import { preloadThemeAssets } from './lib/utils/preload-utils';
|
||||
import useReplyModalStore from './stores/use-reply-modal-store';
|
||||
import useCreateBoardModalStore from './stores/use-create-board-modal-store';
|
||||
import useSpecialThemeStore from './stores/use-special-theme-store';
|
||||
@@ -31,6 +32,10 @@ import DirectoryModal from './components/directory-modal';
|
||||
import DisclaimerModal from './components/disclaimer-modal';
|
||||
import SettingsModal from './components/settings-modal';
|
||||
|
||||
// Preload all theme assets (buttons, backgrounds) immediately on app load
|
||||
// to prevent visible loading delays when switching themes
|
||||
preloadThemeAssets();
|
||||
|
||||
const BoardLayout = () => {
|
||||
const { accountCommentIndex, boardIdentifier } = useParams();
|
||||
const location = useLocation();
|
||||
|
||||
Reference in New Issue
Block a user