fix: allow open CLI from anywhere

This commit is contained in:
Asnxthaony 2023-05-27 00:37:47 +08:00
parent a13879f2df
commit 7d9b34ecc9
No known key found for this signature in database
GPG Key ID: 6537C59306464F54

View File

@ -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),