From e19b2be00f99bed471b3bc4e5a164e66c00fe99c Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Thu, 15 Aug 2024 15:11:20 +0200 Subject: [PATCH] hotfix connect button info and balance checks --- pages/teerdays.vue | 40 ++++++++++++++++++++++++++++++++++------ store/teerAccount.ts | 9 ++++++--- 2 files changed, 40 insertions(+), 9 deletions(-) diff --git a/pages/teerdays.vue b/pages/teerdays.vue index 9133326..ed7150a 100644 --- a/pages/teerdays.vue +++ b/pages/teerdays.vue @@ -6,8 +6,28 @@

blabla

-
- +
+
+ + You need some signer extension to use this page. Please make sure to + enable your extension and reload the page in case the connect button + doesn't work. + +
+ These are some options: +
  • + polkadot.js extension +
  • +
  • + talisman +
  • +
  • + nova wallet +
  • +
  • + subwallet +
  • + others may work too.
    { accountStore.address, ({ value: timestamp_amount }) => { console.log("TEER pending unlock:" + timestamp_amount); - if (timestamp_amount) { + if (timestamp_amount[1]) { let unlockDate = new Date(0); const unlockEpoch = timestamp_amount[0].toNumber(); unlockDate.setUTCMilliseconds(unlockEpoch); diff --git a/store/teerAccount.ts b/store/teerAccount.ts index 7fea366..7cbe558 100644 --- a/store/teerAccount.ts +++ b/store/teerAccount.ts @@ -15,15 +15,18 @@ export const useAccount = defineStore("teerAccount", { getAddress({ address }): string { return address ? address : "none"; }, - getHumanFree({ free }): number { + getHumanFree({ free }): string { return formatBalance(free, { decimals: 12, withUnit: "" }, 12); }, - getHumanReserved({ reserved }): number { + getHumanReserved({ reserved }): string { return formatBalance(reserved, { decimals: 12, withUnit: "" }, 12); }, - getHumanFrozen({ frozen }): number { + getHumanFrozen({ frozen }): string { return formatBalance(frozen, { decimals: 12, withUnit: "" }, 12); }, + getTransferrable({ free, frozen }): number { + return free - frozen; + }, }, actions: { setAddress(address: string) {