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.
This commit is contained in:
parent
e66d976ee8
commit
1a3510becb
2 changed files with 3 additions and 1 deletions
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue