Skip to content

Commit

Permalink
ref(WalletAssetTrades.vue): reorginze code
Browse files Browse the repository at this point in the history
  • Loading branch information
hassnian committed Jan 10, 2025
1 parent 735baf5 commit f84c93b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions components/common/ConnectWallet/WalletAssetTrades.vue
Original file line number Diff line number Diff line change
Expand Up @@ -141,19 +141,18 @@ const tradeTypes = [
TradeType.SWAP,
]
const { accountId } = useAuth()
const { urlPrefix } = usePrefix()
const trades = ref<TradeNftItem[]>([])
const loadings = ref<boolean[]>([])
const refetches = ref<ReturnType<typeof useTrades>['refetch'][]>([])
const { accountId } = useAuth()
const { urlPrefix } = usePrefix()
const { data: ownedCollections, isFetching, isPending } = useOwnedCollections(accountId)
const loadingOwnedCollections = computed(() => isPending.value || isFetching.value)
const disabledTrades = computed(() => loadingOwnedCollections.value)
const where = computed(() => buildIncomingTradesQuery(accountId.value, ownedCollections.value?.map(({ id }) => id) || []))
const loadings = ref<boolean[]>([])
const loading = computed(() => loadings.value.some(Boolean) || loadingOwnedCollections.value)
const refetches = ref<ReturnType<typeof useTrades>['refetch'][]>([])
const clear = () => {
loadings.value = new Array(tradeTypes.length).fill(true)
Expand Down

0 comments on commit f84c93b

Please sign in to comment.