@@ -15,9 +15,11 @@ import {
1515} from '../constants' ;
1616import { useRefreshEvaluationsContext } from '../contexts/RefreshEvaluationsContext' ;
1717import { useSubjectName } from '../hooks/useSubjectName' ;
18- import { useSelector } from '../store/hooks' ;
18+ import { useDispatch , useSelector } from '../store/hooks' ;
1919import BrightIdProfilePicture from './BrightIdProfilePicture' ;
2020import EvaluationThumb from './Shared/EvaluationThumb' ;
21+ import { connectionsApi } from '@/store/api/connections' ;
22+ import { profileApi } from '@/store/api/profile' ;
2123
2224type EvaluateOpNotificationData = {
2325 text : string ;
@@ -106,6 +108,7 @@ export default function EvaluationOpNotifications() {
106108 const operations = useSelector ( selectEvaluateOperations ) ;
107109
108110 const prevOperationsRef = useRef < EvaluateSubmittedOperation [ ] | null > ( null ) ;
111+ const dispatch = useDispatch ( ) ;
109112
110113 useEffect ( ( ) => {
111114 const storedOperations = localStorage . getItem ( 'prevOperations' ) ;
@@ -166,6 +169,10 @@ export default function EvaluationOpNotifications() {
166169 prevOperation . state !== operation_states . APPLIED &&
167170 operation . state === operation_states . APPLIED
168171 ) {
172+ dispatch ( connectionsApi . util . invalidateTags ( [ { type : 'BrightID' } ] ) ) ;
173+
174+ dispatch ( profileApi . util . invalidateTags ( [ { type : 'BrightID' } ] ) ) ;
175+
169176 addNotification ( {
170177 operation,
171178 text : `Applied!` ,
@@ -186,7 +193,7 @@ export default function EvaluationOpNotifications() {
186193 // Update ref and localStorage with the latest operations
187194 prevOperationsRef . current = operations ;
188195 localStorage . setItem ( 'prevOperations' , JSON . stringify ( operations ) ) ;
189- } , [ addNotification , operations , refreshEvaluations ] ) ;
196+ } , [ addNotification , operations , refreshEvaluations , dispatch ] ) ;
190197
191198 return (
192199 < div className = "w-full" >
0 commit comments