Skip to content

Commit

Permalink
refresh auction balance and my credit balance
Browse files Browse the repository at this point in the history
  • Loading branch information
ba1ciu committed Jun 19, 2023
1 parent 17065a3 commit 424a471
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion frontend/marketplace/src/components/CreditTabContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,12 @@ const getCreditsData = async () => {
const loadQueryData = (query: string) => {
showSpinner.value = true
const {result, loading, error} = useQuery(gql`${query}`);
const {result, loading, error, refetch} = useQuery(gql`${query}`);
data.value = {result, loading, error}
showSpinner.value = false
setInterval(() => {
refetch()
}, 5000)
}
onMounted(() => {
Expand Down
7 changes: 6 additions & 1 deletion frontend/marketplace/src/pages/AuctionDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,11 @@ const getAuctionDetails = (id: string | string[]) => {
}
`
const {result, loading, error} = useQuery(gql`${query}`);
const {result, loading, error, refetch} = useQuery(gql`${query}`);
data.value = {result, loading, error}
setInterval(() => {
refetch()
}, 5000);
watch(result, value => {
auctionDetails.value = getDetailsList(value.marketplaceListings?.nodes[0].creditCollection.creditData.nodes)
Expand All @@ -148,6 +151,7 @@ const getAuctionDetails = (id: string | string[]) => {
showSpinner.value = false
denom.value = result.value?.marketplaceListings?.nodes[0].denom
owner.value = result.value?.marketplaceListings?.nodes[0].owner
console.log(`${data?.value.result?.marketplaceListings?.nodes[0].amount}/${data?.value.result?.marketplaceListings?.nodes[0].initialAmount}`)
}
const getOrderHistory = (id: string | string[]) => {
Expand All @@ -173,6 +177,7 @@ const getOrderHistory = (id: string | string[]) => {
const {result, loading, error} = useQuery(gql`${query}`);
orderHistory.value = {result, loading, error}
}
onMounted(() => {
getAuctionDetails(router.params.id)
getOrderHistory(router.params.id)
Expand Down

0 comments on commit 424a471

Please sign in to comment.