Skip to content

Commit

Permalink
fix deposit form with referrer from contract (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sorizen authored Nov 6, 2024
1 parent 8330d76 commit 192df01
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/forms/DepositForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,12 @@ const onSubmit = async () => {
if (action.value == ACTIONS.stake) await submit(ACTIONS.stake)
}
const loadReferrer = async () => {
const referrer = (userPoolData.value as Erc1967ProxyType.UserData)?.referrer
if (referrer === ethers.constants.AddressZero) return
form.referrer = referrer
}
const init = async (): Promise<void> => {
isInitializing.value = true
Expand Down Expand Up @@ -305,6 +311,10 @@ watch(
}
if (isMultiplierShown.value) {
await fetchExpectedMultiplier(form.lockPeriod)
if (!route.query?.referrer && !form.referrer) {
await loadReferrer()
}
}
},
)
Expand Down

0 comments on commit 192df01

Please sign in to comment.