File tree Expand file tree Collapse file tree 4 files changed +16
-16
lines changed
Expand file tree Collapse file tree 4 files changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -21,8 +21,8 @@ export function useChat(sessionId?: string) {
2121 // Mutation for creating a new session
2222 const createSession = useMutation ( {
2323 mutationFn : ( ) => bedrockService . createChatSession ( ) ,
24- onSuccess : ( newSessionId ) => {
25- queryClient . invalidateQueries ( { queryKey : [ QueryKey . Chat , 'sessions' ] } ) ;
24+ onSuccess : async ( newSessionId ) => {
25+ await queryClient . invalidateQueries ( { queryKey : [ QueryKey . Chat , 'sessions' ] } ) ;
2626 return newSessionId ;
2727 } ,
2828 } ) ;
@@ -33,9 +33,9 @@ export function useChat(sessionId?: string) {
3333 if ( ! sessionId ) throw new Error ( 'No active session' ) ;
3434 return bedrockService . sendMessage ( sessionId , message ) ;
3535 } ,
36- onSuccess : ( ) => {
37- queryClient . invalidateQueries ( { queryKey : [ QueryKey . Chat , sessionId ] } ) ;
38- queryClient . invalidateQueries ( { queryKey : [ QueryKey . Chat , 'sessions' ] } ) ;
36+ onSuccess : async ( ) => {
37+ await queryClient . invalidateQueries ( { queryKey : [ QueryKey . Chat , sessionId ] } ) ;
38+ await queryClient . invalidateQueries ( { queryKey : [ QueryKey . Chat , 'sessions' ] } ) ;
3939 } ,
4040 } ) ;
4141
Original file line number Diff line number Diff line change @@ -60,9 +60,9 @@ export const useSignIn = () => {
6060
6161 return useMutation ( {
6262 mutationFn : signIn ,
63- onSuccess : ( ) => {
64- queryClient . invalidateQueries ( { queryKey : [ QueryKey . UserTokens ] } ) ;
65- queryClient . invalidateQueries ( { queryKey : [ QueryKey . Users , 'current' ] } ) ;
63+ onSuccess : async ( ) => {
64+ await queryClient . invalidateQueries ( { queryKey : [ QueryKey . UserTokens ] } ) ;
65+ await queryClient . invalidateQueries ( { queryKey : [ QueryKey . Users , 'current' ] } ) ;
6666 } ,
6767 } ) ;
6868} ;
Original file line number Diff line number Diff line change @@ -73,8 +73,8 @@ const ProcessingPage: React.FC = () => {
7373
7474 console . log ( 'Processing complete' ) ;
7575
76- queryClient . invalidateQueries ( { queryKey : [ QueryKey . Reports ] } ) ;
77- queryClient . invalidateQueries ( { queryKey : [ QueryKey . LatestReports ] } ) ;
76+ await queryClient . invalidateQueries ( { queryKey : [ QueryKey . Reports ] } ) ;
77+ await queryClient . invalidateQueries ( { queryKey : [ QueryKey . LatestReports ] } ) ;
7878
7979 history . push ( `/tabs/reports/${ reportId } ` ) ;
8080 } else if ( data . status === 'failed' ) {
Original file line number Diff line number Diff line change @@ -109,9 +109,9 @@ const ReportDetailPage: React.FC = () => {
109109 duration : 2000 ,
110110 } ) ;
111111
112- queryClient . invalidateQueries ( { queryKey : [ QueryKey . Reports ] } ) ;
113- queryClient . invalidateQueries ( { queryKey : [ QueryKey . LatestReports ] } ) ;
114- queryClient . invalidateQueries ( { queryKey : [ QueryKey . ReportDetail , reportId ] } ) ;
112+ await queryClient . invalidateQueries ( { queryKey : [ QueryKey . Reports ] } ) ;
113+ await queryClient . invalidateQueries ( { queryKey : [ QueryKey . LatestReports ] } ) ;
114+ await queryClient . invalidateQueries ( { queryKey : [ QueryKey . ReportDetail , reportId ] } ) ;
115115
116116 // Navigate back
117117 history . push ( '/tabs/home' ) ;
@@ -136,9 +136,9 @@ const ReportDetailPage: React.FC = () => {
136136 await axios . delete ( `${ API_URL } /api/reports/${ reportId } ` , await getAuthConfig ( ) ) ;
137137 setIsProcessing ( false ) ;
138138
139- queryClient . invalidateQueries ( { queryKey : [ QueryKey . Reports ] } ) ;
140- queryClient . invalidateQueries ( { queryKey : [ QueryKey . LatestReports ] } ) ;
141- queryClient . invalidateQueries ( { queryKey : [ QueryKey . ReportDetail , reportId ] } ) ;
139+ await queryClient . invalidateQueries ( { queryKey : [ QueryKey . Reports ] } ) ;
140+ await queryClient . invalidateQueries ( { queryKey : [ QueryKey . LatestReports ] } ) ;
141+ await queryClient . invalidateQueries ( { queryKey : [ QueryKey . ReportDetail , reportId ] } ) ;
142142
143143 setIsUploadModalOpen ( true ) ;
144144 } catch ( error ) {
You can’t perform that action at this time.
0 commit comments