From 6a7f9927f0b5bb9ba3ac08134066b4d46add5319 Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 24 Jan 2024 21:42:35 +0700 Subject: [PATCH] Fix time left --- .eslintrc-auto-import.json | 3 ++- src/components/SpaceProposalBoostClaim.vue | 28 +++++++++++++++++----- src/components/SpaceProposalBoostItem.vue | 4 +++- 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/.eslintrc-auto-import.json b/.eslintrc-auto-import.json index 67d443fea13..865250957c2 100644 --- a/.eslintrc-auto-import.json +++ b/.eslintrc-auto-import.json @@ -123,6 +123,7 @@ "useBalances": true, "useAccount": true, "useNetwork": true, - "usePayment": true + "usePayment": true, + "useChangeNetwork": true } } diff --git a/src/components/SpaceProposalBoostClaim.vue b/src/components/SpaceProposalBoostClaim.vue index de575aa9449..f1783122646 100644 --- a/src/components/SpaceProposalBoostClaim.vue +++ b/src/components/SpaceProposalBoostClaim.vue @@ -167,6 +167,11 @@ async function loadVouchers(boosts: BoostSubgraph[]) { console.error('Get vouchers error:', e); } } + +const timeLeftToClaim = computed(() => { + if (!unclaimedBoosts.value.length) return 0; + return Number(unclaimedBoosts.value[0].end) - Math.floor(Date.now() / 1000); +});