this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Experimental preload icons

+15 -2
+14 -1
src/app.jsx
··· 21 21 import AccountSheet from './components/account-sheet'; 22 22 import Compose from './components/compose'; 23 23 import Drafts from './components/drafts'; 24 - import Icon from './components/icon'; 24 + import Icon, { ICONS } from './components/icon'; 25 25 import Loader from './components/loader'; 26 26 import MediaModal from './components/media-modal'; 27 27 import Modal from './components/modal'; ··· 65 65 import usePageVisibility from './utils/usePageVisibility'; 66 66 67 67 window.__STATES__ = states; 68 + 69 + // Preload icons 70 + // There's probably a better way to do this 71 + // Related: https://github.com/vitejs/vite/issues/10600 72 + setTimeout(() => { 73 + for (const icon in ICONS) { 74 + if (Array.isArray(ICONS[icon])) { 75 + ICONS[icon][0]?.(); 76 + } else { 77 + ICONS[icon]?.(); 78 + } 79 + } 80 + }, 5000); 68 81 69 82 function App() { 70 83 const snapStates = useSnapshot(states);
+1 -1
src/components/icon.jsx
··· 8 8 xxl: 32, 9 9 }; 10 10 11 - const ICONS = { 11 + export const ICONS = { 12 12 x: () => import('@iconify-icons/mingcute/close-line'), 13 13 heart: () => import('@iconify-icons/mingcute/heart-line'), 14 14 bookmark: () => import('@iconify-icons/mingcute/bookmark-line'),