Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: my position is not loading when switch the network #343

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tarunyadav1
Copy link
Contributor

Technical Description

  • Fix my positions are not loading when switching the network.

Note

  • My position is now loading properly while switching the network. One issue remaining here is that the useEffect is rendering multiple times. This should not happen, the cause of the issue I think is useQuery hooks that fetch the balances. @juliankrispel is there something we can do to conditionally render useQuery hooks.

PR Checklist

  • Has the pr been tested manually by at least 1 reviewer?
  • Has all feedback been addressed?
  • Are all tests and linters running without error?

Copy link
Collaborator

@Walodja1987 Walodja1987 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Tarun. I tested it and the problem doesn't seem to be resolved yet. See my loom: https://www.loom.com/share/a328847711964d6b8f686e3f99676211

@juliankrispel
Copy link
Collaborator

is there something we can do to conditionally render useQuery hooks.

You can't render hooks conditionally - see rules of hooks

Copy link
Collaborator

@juliankrispel juliankrispel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure what the hook is for tbh

: []

setFilterPosition(filteredRows)
}, [balances])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just wrapping it inside a useEffect - I don't think that solves anything?

@juliankrispel
Copy link
Collaborator

@tarunyadav1 what's happening with this PR cc @Walodja1987

@Walodja1987
Copy link
Collaborator

@tarunyadav1 what's happening with this PR cc @Walodja1987

Would be good if someone could help to solve that issue

@Walodja1987
Copy link
Collaborator

Given that we want to launch on one single network, this has lower priority right now. However, if someone knows how to fix that, please feel free to help out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: My Positions not loading when network is switched on Markets page
3 participants