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) {
21
21
// Mutation for creating a new session
22
22
const createSession = useMutation ( {
23
23
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' ] } ) ;
26
26
return newSessionId ;
27
27
} ,
28
28
} ) ;
@@ -33,9 +33,9 @@ export function useChat(sessionId?: string) {
33
33
if ( ! sessionId ) throw new Error ( 'No active session' ) ;
34
34
return bedrockService . sendMessage ( sessionId , message ) ;
35
35
} ,
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' ] } ) ;
39
39
} ,
40
40
} ) ;
41
41
Original file line number Diff line number Diff line change @@ -60,9 +60,9 @@ export const useSignIn = () => {
60
60
61
61
return useMutation ( {
62
62
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' ] } ) ;
66
66
} ,
67
67
} ) ;
68
68
} ;
Original file line number Diff line number Diff line change @@ -73,8 +73,8 @@ const ProcessingPage: React.FC = () => {
73
73
74
74
console . log ( 'Processing complete' ) ;
75
75
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 ] } ) ;
78
78
79
79
history . push ( `/tabs/reports/${ reportId } ` ) ;
80
80
} else if ( data . status === 'failed' ) {
Original file line number Diff line number Diff line change @@ -109,9 +109,9 @@ const ReportDetailPage: React.FC = () => {
109
109
duration : 2000 ,
110
110
} ) ;
111
111
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 ] } ) ;
115
115
116
116
// Navigate back
117
117
history . push ( '/tabs/home' ) ;
@@ -136,9 +136,9 @@ const ReportDetailPage: React.FC = () => {
136
136
await axios . delete ( `${ API_URL } /api/reports/${ reportId } ` , await getAuthConfig ( ) ) ;
137
137
setIsProcessing ( false ) ;
138
138
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 ] } ) ;
142
142
143
143
setIsUploadModalOpen ( true ) ;
144
144
} catch ( error ) {
You can’t perform that action at this time.
0 commit comments