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

index favorites by uniqueId instead of address #5972

Merged
merged 3 commits into from
Aug 2, 2024
Merged

Conversation

greg-schrammel
Copy link
Contributor

Fixes APP-1683 APP-1676

What changed (plus any additional context for devs)

we can't store based on just the address because for example the degen token in the degen network is address zero, same we use sometimes for eth in mainnet, found lots of lil weird bugs like that I think this fixes it all, probably good to QA this one

Screen recordings / screenshots

What to test

const query = useQuery({
queryKey: favoritesQueryKey,
queryFn: refreshFavorites,
staleTime: 24 * 60 * 60 * 1000, // 24hrs
Copy link
Contributor Author

Choose a reason for hiding this comment

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

instead of refetching every time the app loads, refresh once after 24hrs stale


const updatedMetadataByNetwork = await Promise.all(
Object.entries(favoritesByNetwork).map(async ([network, networkFavorites]) =>
fetchMetadata(networkFavorites, ethereumUtils.getChainIdFromNetwork(network as Network))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this splits the tokens that don't have a mainnet address to fetchMetadata from their network instead
like the case for degen

src/resources/favorites.ts Outdated Show resolved Hide resolved
src/resources/favorites.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@walmat walmat left a comment

Choose a reason for hiding this comment

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

See comments. Played around with it a bit and also noticed that the filtering of inputAsset from favorites got broken. That'll need fixed too.
Screenshot 2024-07-31 at 11 42 50 AM

@greg-schrammel greg-schrammel merged commit 6d28cfc into develop Aug 2, 2024
6 checks passed
@greg-schrammel greg-schrammel deleted the fix-favorites branch August 2, 2024 16:32
ibrahimtaveras00 added a commit that referenced this pull request Aug 5, 2024
ibrahimtaveras00 pushed a commit that referenced this pull request Aug 7, 2024
* 👍

* migration

* add networks placeholder to default favorites
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.

2 participants