mirror of
https://github.com/elk-zone/elk.git
synced 2024-11-04 16:09:59 +00:00
fix: fix gist loading
This commit is contained in:
parent
a6a189ba59
commit
c60476a062
1 changed files with 8 additions and 2 deletions
|
@ -4,8 +4,14 @@ import type { AppInfo } from '~/types'
|
|||
export const registeredApps: Record<string, AppInfo> = {}
|
||||
|
||||
const runtimeConfig = useRuntimeConfig()
|
||||
const promise = $fetch(runtimeConfig.registedAppsUrl)
|
||||
.then(r => Object.assign(registeredApps, r))
|
||||
const promise = $fetch(runtimeConfig.registedAppsUrl, { responseType: 'json' })
|
||||
.then((r) => {
|
||||
Object.assign(registeredApps, r)
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`\n${Object.keys(registeredApps).length} registered apps loaded from ${runtimeConfig.registedAppsUrl.split(/\/+/g)[1]}`)
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`${Object.keys(registeredApps).map(i => ` - ${i}`).join('\n')}\n`)
|
||||
})
|
||||
.catch((e) => {
|
||||
if (process.dev)
|
||||
console.error('Failed to fetch registered apps,\nyou may need to run `nr register-apps` first')
|
||||
|
|
Loading…
Reference in a new issue