From 7d9b34ecc97120a23b852e5f21a3841d7aabe662 Mon Sep 17 00:00:00 2001 From: Asnxthaony Date: Sat, 27 May 2023 00:37:47 +0800 Subject: [PATCH] fix: allow open CLI from anywhere --- resources/assets/src/index.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/resources/assets/src/index.tsx b/resources/assets/src/index.tsx index 573fa209..370fc0ba 100644 --- a/resources/assets/src/index.tsx +++ b/resources/assets/src/index.tsx @@ -6,13 +6,11 @@ import routes from './scripts/route' Object.assign(window, { React, ReactDOM, $ }) -if (blessing.route.startsWith('admin')) { - const entry = document.querySelector('[href="#launch-cli"]') - entry?.addEventListener('click', async () => { - const { launch } = await import('./scripts/cli') - launch() - }) -} +const entry = document.querySelector('[href="#launch-cli"]') +entry?.addEventListener('click', async () => { + const { launch } = await import('./scripts/cli') + launch() +}) const route = routes.find((route) => new RegExp(`^${route.path}$`, 'i').test(blessing.route),