Skip to content

Commit

Permalink
use ref
Browse files Browse the repository at this point in the history
  • Loading branch information
aggre committed Nov 30, 2023
1 parent 2bfa83e commit c89f558
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/components/Join/JoinClub.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ const { propertyAddress, tiers, tenantName, rpcUrl, preferedCurrency } =
preferedCurrency?: 'dev' | 'eth'
}>()
let currency: Data['currency'] = preferedCurrency ?? 'dev'
let composedTiers: Data['composedTiers'] = {
const currency = ref<Data['currency']>(preferedCurrency ?? 'dev')
const composedTiers = ref<Data['composedTiers']>({
dev: preferedCurrency === 'dev' ? [...tiers] : undefined,
eth: preferedCurrency === 'eth' ? [...tiers] : undefined,
}
})
const images: Data['images'] = {
DEV: DEV.src,
ETH: ETH.src,
Expand All @@ -93,11 +93,11 @@ onMounted(async () => {
const input = new FormData(form.value as HTMLFormElement).get('input') as
| null
| Data['currency']
currency = input as 'dev' | 'eth'
currency.value = input as 'dev' | 'eth'
if (preferedCurrency === 'eth') {
return
}
composedTiers = await composeTiers({
composedTiers.value = await composeTiers({
sourceTiers: tiers,
provider: new JsonRpcProvider(rpcUrl),
tokenAddress: propertyAddress ?? '',
Expand All @@ -107,6 +107,6 @@ onMounted(async () => {
const switchInputs = (ev: Event) => {
const { value } = ev.target as HTMLInputElement
currency = value as 'dev' | 'eth'
currency.value = value as 'dev' | 'eth'
}
</script>

0 comments on commit c89f558

Please sign in to comment.