@@ -14,6 +14,7 @@ import { Events } from 'app/utils/zod/activity/events'
14
14
import { useCallback , useEffect , useMemo , useRef , useState } from 'react'
15
15
import type { ZodError } from 'zod'
16
16
import { TokenActivityRow } from './TokenActivityRow'
17
+ import { useRootScreenParams } from 'app/routers/params'
17
18
18
19
export const TokenActivityFeed = ( {
19
20
tokenActivityFeedQuery,
@@ -31,6 +32,7 @@ export const TokenActivityFeed = ({
31
32
const media = useMedia ( )
32
33
const queryClient = useQueryClient ( )
33
34
const wasPendingRef = useRef ( false ) // Ref to track if a pending activity was seen previously
35
+ const [ queryParams ] = useRootScreenParams ( )
34
36
35
37
const layoutSizeAdjustment = media . gtLg ? 32 : 14
36
38
@@ -74,12 +76,15 @@ export const TokenActivityFeed = ({
74
76
// If it was pending previously but isn't anymore, invalidate the activity feed query
75
77
if ( wasPendingRef . current && ! isCurrentlyPending ) {
76
78
// Invalidate the query
77
- queryClient . invalidateQueries ( { queryKey : [ 'activity_feed' ] } )
79
+ queryClient . invalidateQueries ( {
80
+ queryKey : [ 'token_activity_feed' , { address : queryParams . token } ] ,
81
+ exact : false ,
82
+ } )
78
83
}
79
84
80
85
// Update the ref to store the current pending state for the next effect run
81
86
wasPendingRef . current = isCurrentlyPending
82
- } , [ data , queryClient ] )
87
+ } , [ data , queryClient , queryParams . token ] )
83
88
84
89
const [ dataProvider , setDataProvider ] = useState ( dataProviderMaker ( activities ) )
85
90
0 commit comments