Split desktop and mobile layouts with shared page data so APIs fetch once per context.
Add layout shells, desktop views, module-level page caches, and UI fixes for auth, home, wallet, transactions, address, and related pages. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+14
-10
@@ -3,6 +3,7 @@ import { defineStore } from 'pinia'
|
||||
import { getSettings } from '@/api/configuration'
|
||||
import { resolveMeltedGoldLabel, resolveMetalTypeLabel } from '@/utils/metalLabels'
|
||||
import { resolveTradeWeightUnit } from '@/utils/weightUnit'
|
||||
import { runOnceAsync } from '@/composables/useOnceAsync'
|
||||
|
||||
export interface AppSetting {
|
||||
id?: number
|
||||
@@ -45,17 +46,20 @@ export const useSettingsStore = defineStore('settings', () => {
|
||||
settings.value = merged
|
||||
}
|
||||
|
||||
async function fetchSettings() {
|
||||
try {
|
||||
const data = await getSettings()
|
||||
if (Array.isArray(data)) {
|
||||
mergeSettings(data)
|
||||
async function fetchSettings(force = false) {
|
||||
return runOnceAsync('settings:all', async () => {
|
||||
try {
|
||||
const data = await getSettings()
|
||||
if (Array.isArray(data)) {
|
||||
mergeSettings(data)
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
} finally {
|
||||
loaded.value = true
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
} finally {
|
||||
loaded.value = true
|
||||
}
|
||||
return settings.value
|
||||
}, force)
|
||||
}
|
||||
|
||||
const metalTypeSettingValue = computed(() => getSettingByKey('metal_type'))
|
||||
|
||||
Reference in New Issue
Block a user