++
This commit is contained in:
@@ -66,7 +66,14 @@ export const useSettingsStore = defineStore('settings', () => {
|
||||
const weixin = ref<Record<string, any>>({})
|
||||
const platforms = ref<Record<string, any>>({})
|
||||
|
||||
async function fetchSettings() {
|
||||
let settingsLoadPromise: Promise<void> | null = null
|
||||
function fetchSettings(): Promise<void> {
|
||||
if (settingsLoadPromise) return settingsLoadPromise
|
||||
settingsLoadPromise = loadSettings().finally(() => { settingsLoadPromise = null })
|
||||
return settingsLoadPromise
|
||||
}
|
||||
|
||||
async function loadSettings() {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await configApi.fetchConfig()
|
||||
|
||||
Reference in New Issue
Block a user