Skip to content

Commit

Permalink
ENG-4797 fix(portal): prevent vault details fetch before stake modal …
Browse files Browse the repository at this point in the history
…is opened (#930)

## Affected Packages

Apps

- [ ] data populator
- [x] portal
- [ ] template

Packages

- [ ] 1ui
- [ ] api
- [ ] graphql
- [ ] protocol
- [ ] sdk

Tools

- [ ] tools

## Overview

Overview of the changes in the PR.

## Screen Captures

- Fixes an issue where StakeModal was trying to fetch vault details
before it was opened which was causing a 500 because vault_id was
undefined.

## Declaration

- [x] I hereby declare that I have abided by the rules and regulations
as outlined in the
[CONTRIBUTING.md](https://github.com/0xIntuition/intuition-ts/blob/main/CONTRIBUTING.md)
  • Loading branch information
Vitalsine85 authored Nov 19, 2024
1 parent 7e25445 commit 07d25e7
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions apps/portal/app/components/stake/stake-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ export default function StakeModal({
direction,
onSuccess,
}: StakeModalProps) {
console.log('claim', claim)
console.log('direction', direction)
const fetchReval = useFetcher()
const [stakeModalState] = useAtom(stakeModalAtom)
const { mode, modalType } = stakeModalState
Expand Down Expand Up @@ -110,7 +108,7 @@ export default function StakeModal({
useEffect(() => {
let isCancelled = false

if (vaultId !== null) {
if (open && vaultId !== null) {
const finalUrl = `${GET_VAULT_DETAILS_RESOURCE_ROUTE}?contract=${contract}&vaultId=${vaultId}&fetchId=${fetchId}`
if (!isCancelled) {
vaultDetailsFetcher.load(finalUrl)
Expand Down

0 comments on commit 07d25e7

Please sign in to comment.