-
Notifications
You must be signed in to change notification settings - Fork 3
fix(PE-8428): reduce use of dispatchArNSState #800
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
base: develop
Are you sure you want to change the base?
Changes from 1 commit
7c54bd8
4d1a424
15e218b
410746b
3ad7972
dfc7a5c
7b0514f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,7 +23,7 @@ export const useAntsForWallet = (): UseQueryResult< | |
| const { data: antVersions = {} } = useANTVersions(); | ||
| const { data: latestAntVersion } = useLatestANTVersion(); | ||
| return useQuery({ | ||
| queryKey: ['ants', walletAddress?.toString()], | ||
| queryKey: ['ants-with-metadata', walletAddress?.toString()], | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hyperbeamUrl, aoNetwork.ANT, accessControlList, antVersions should be added to the query key so that if they are updated the data is reevaluated. Main concern there is accessControlList There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And actually doesn't look like we need wallet address here. Fine to have it, but it doesn't affect the query. |
||
| queryFn: async () => { | ||
| const antAo = connect(aoNetwork.ANT); | ||
| const uniqueAnts = [ | ||
|
|
@@ -35,13 +35,19 @@ export const useAntsForWallet = (): UseQueryResult< | |
| const antsWithMetadata = await Promise.all( | ||
| uniqueAnts.map(async (processId) => { | ||
| const [state, processMeta] = await Promise.all([ | ||
| queryClient.fetchQuery( | ||
| buildAntStateQuery({ | ||
| processId, | ||
| ao: antAo, | ||
| hyperbeamUrl: hyperbeamUrl, | ||
| queryClient | ||
| .fetchQuery( | ||
| buildAntStateQuery({ | ||
| processId, | ||
| ao: antAo, | ||
| hyperbeamUrl: hyperbeamUrl, | ||
| }), | ||
| ) | ||
| .catch((e) => { | ||
| console.error(e); | ||
| return undefined; | ||
| }), | ||
| ), | ||
| // TODO: send these in a single request | ||
| queryClient | ||
| .fetchQuery( | ||
| buildGraphQLQuery(aoNetwork.ANT.GRAPHQL_URL, { | ||
|
|
@@ -54,7 +60,6 @@ export const useAntsForWallet = (): UseQueryResult< | |
| return null; | ||
| }), | ||
| ]); | ||
|
|
||
| const moduleId = processMeta?.tags.find( | ||
| (tag) => tag.name === 'Module', | ||
| )?.value; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.