mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
added preload for all assets
This commit is contained in:
+1
-1
@@ -67,7 +67,7 @@ export default function App() {
|
||||
// preload banners
|
||||
useEffect(() => {
|
||||
const loadImages = async () => {
|
||||
const images = await importAll(require.context('../public/assets/banners', false, /\.(png|jpe?g|svg)$/));
|
||||
const images = await importAll(require.context('../public/assets', true, /\.(png|jpe?g|svg)$/));
|
||||
const imageUrls = images.map((image) => image.default);
|
||||
preloadImages(imageUrls);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user