diff --git a/components/DataTableMyRelays/DataTableMyRelays.vue b/components/DataTableMyRelays/DataTableMyRelays.vue index 1b0ebec..562efdd 100755 --- a/components/DataTableMyRelays/DataTableMyRelays.vue +++ b/components/DataTableMyRelays/DataTableMyRelays.vue @@ -88,6 +88,29 @@ const ethAddressError = ref(null); const fingerPrintRegister = ref(''); const fingerPrintRegisterError = ref(null); +const relayCredits = ref>({}); +const familyVerified = ref>({}); +const registrationCreditsRequired = ref(true); +const familyRequired = ref(true); + +const fetchRegistrationCredit = async () => { + if (allRelays.value) { + for (const relay of filterUniqueRelays(allRelays.value)) { + relayCredits.value[relay.fingerprint] = + await userStore.hasRegistrationCredit(relay.fingerprint); + familyVerified.value[relay.fingerprint] = await userStore.familyVerified2( + relay.fingerprint + ); + } + } + + registrationCreditsRequired.value = userStore.registrationCreditsRequired; + familyRequired.value = userStore.familyRequired; +}; + +// Fetch the registration credits when the relays are loaded +watch(allRelays, fetchRegistrationCredit); + if ((allRelaysError as any).value?.cause?.message == 'rate limited') { toast.add({ id: 'claimable-relays-error', @@ -553,6 +576,10 @@ const handleUnlockClick = async (fingerprint: string) => { userStore.isHardwareRelay(row.fingerprint) " :is-loading="registratorStore.loading" + :has-registration-credit="relayCredits[row.fingerprint]" + :registration-credits-required="registrationCreditsRequired" + :family-verified="familyVerified[row.fingerprint]" + :family-required="familyRequired" />