From 81a6b181656f1946b1887d8145bd2d3d3d417c1a Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 12 Dec 2023 18:00:45 +0000 Subject: [PATCH] =?UTF-8?q?chore:=20cloudcmd:=20actions:=20lint=20?= =?UTF-8?q?=E2=98=98=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/query.css | 2 +- server/user-menu.js | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/css/query.css b/css/query.css index 9801509a..f1734ef6 100644 --- a/css/query.css +++ b/css/query.css @@ -104,7 +104,7 @@ /* iphone 6 landscape */ @media only screen and (device-width >= 375px) and (device-width <= 667px) and (orientation: landscape), - only screen and (max-height: 360px) and (max-width: 640px) { + only screen and (height <= 360px) and (width <= 640px) { .fm { height: 55%; } diff --git a/server/user-menu.js b/server/user-menu.js index da3f1ec6..cce853fd 100644 --- a/server/user-menu.js +++ b/server/user-menu.js @@ -22,56 +22,56 @@ const DEFAULT_MENU_PATH = join(__dirname, '../static/user-menu.js'); module.exports = currify(async ({menuName}, req, res, next) => { if (req.url.indexOf(URL)) return next(); - + const {method} = req; - + if (method === 'GET') return await onGET({ req, res, menuName, }); - + next(); }); async function onGET({req, res, menuName}) { const {dir} = req.query; const url = req.url.replace(URL, ''); - + if (url === '/default') return sendDefaultMenu(res); - + const {findUp} = await import('find-up'); - + const [errorFind, currentMenuPath] = await tryToCatch(findUp, [menuName], { cwd: dir, }); - + if (errorFind && errorFind.code !== 'ENOENT') return res .status(404) .send(errorFind.message); - + const homeMenuPath = join(homedir(), menuName); const menuPath = currentMenuPath || homeMenuPath; const [e, source] = await tryToCatch(readFile, menuPath, 'utf8'); - + if (e && e.code !== 'ENOENT') return res .status(404) .send(e.message); - + if (e) return sendDefaultMenu(res); - + const [parseError, result] = await transpile(source); - + if (parseError) return res .type('js') .send(getError(parseError, source)); - + res .type('js') .send(result.code);