From d8f6a59f17ddd23e1d33a8c457ffdd298c8d20ff Mon Sep 17 00:00:00 2001 From: Yann Le Vagueres Date: Sun, 10 Sep 2023 20:43:04 +0200 Subject: [PATCH] Added preload to custom scripts and styles so they can load earlier --- src/pages/api/config/[path].js | 1 + src/pages/index.jsx | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pages/api/config/[path].js b/src/pages/api/config/[path].js index b7ac1f0c..a7da7eec 100644 --- a/src/pages/api/config/[path].js +++ b/src/pages/api/config/[path].js @@ -17,6 +17,7 @@ export default async function handler(req, res) { if (!['custom.css', 'custom.js'].includes(relativePath)) { res.status(422).end('Unsupported file') + return // do not continue in the function } const filePath = path.join(CONF_DIR, relativePath); diff --git a/src/pages/index.jsx b/src/pages/index.jsx index 187f4c19..65426862 100644 --- a/src/pages/index.jsx +++ b/src/pages/index.jsx @@ -313,14 +313,16 @@ function Home({ initialSettings }) { - -