File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,9 @@ export const useMovie = (movieId) => {
32
32
await queryClient . cancelQueries ( movieKeys . detail ( movieId ) ) ;
33
33
const previousData = queryClient . getQueryData ( movieKeys . detail ( movieId ) ) ;
34
34
35
+ // remove local state so that server state is taken instead
36
+ setComment ( undefined ) ;
37
+
35
38
queryClient . setQueryData ( movieKeys . detail ( movieId ) , {
36
39
...previousData ,
37
40
movie : {
@@ -46,8 +49,6 @@ export const useMovie = (movieId) => {
46
49
queryClient . setQueryData ( movieKeys . detail ( movieId ) , context . previousData ) ;
47
50
} ,
48
51
onSettled : ( ) => {
49
- // remove local state so that server state is taken instead
50
- setComment ( undefined ) ;
51
52
queryClient . invalidateQueries ( movieKeys . detail ( movieId ) ) ;
52
53
} ,
53
54
} ) ;
You can’t perform that action at this time.
0 commit comments