From 1a3510becb074e857c073163bfe2dbe07f1b1aa4 Mon Sep 17 00:00:00 2001 From: padreug Date: Sat, 2 Aug 2025 17:53:26 +0200 Subject: [PATCH] fix: Improve loading state management in useMarket and Market.vue - Update useMarket composable to set loading state in marketStore during market loading. - Refine loading condition in Market.vue to only check marketStore.isLoading, enhancing clarity and performance. --- src/composables/useMarket.ts | 2 ++ src/pages/Market.vue | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/composables/useMarket.ts b/src/composables/useMarket.ts index 4095ec9..3d6bfb1 100644 --- a/src/composables/useMarket.ts +++ b/src/composables/useMarket.ts @@ -24,6 +24,7 @@ export function useMarket() { const loadMarket = async (naddr: string) => { try { isLoading.value = true + marketStore.setLoading(true) error.value = null console.log('Loading market with naddr:', naddr) @@ -45,6 +46,7 @@ export function useMarket() { // Don't throw error, let the UI handle it gracefully } finally { isLoading.value = false + marketStore.setLoading(false) } } diff --git a/src/pages/Market.vue b/src/pages/Market.vue index ef5fc30..e9c3ccf 100644 --- a/src/pages/Market.vue +++ b/src/pages/Market.vue @@ -1,7 +1,7 @@