File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
packages/ra-core/src/auth Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -111,22 +111,23 @@ const useLogout = (): Logout => {
111111 if ( redirectToParts [ 1 ] ) {
112112 newLocation . search = redirectToParts [ 1 ] ;
113113 }
114- navigateRef . current ( newLocation , {
115- ...newLocationOptions ,
116- flushSync : true ,
117- } ) ;
118114
119- // We need to reset the store after a litte delay to avoid a race condition
115+ // We need to navigate and reset the store after a litte delay to avoid a race condition
120116 // between the store reset and the navigation.
121117 //
122118 // This would only happen when the `authProvider.getPermissions` method returns
123119 // a resolved promise with no delay: If the store was reset before the navigation,
124120 // the `usePermissions` query would reset, causing the `CoreAdminRoutes` component to
125121 // rerender the `LogoutOnMount` component leading to an infinite loop.
126- window . requestAnimationFrame ( ( ) => {
122+ setTimeout ( ( ) => {
123+ navigateRef . current (
124+ newLocation ,
125+ newLocationOptions
126+ ) ;
127+
127128 resetStore ( ) ;
128129 queryClient . clear ( ) ;
129- } ) ;
130+ } , 0 ) ;
130131
131132 return redirectToFromProvider ;
132133 } ) ;
You can’t perform that action at this time.
0 commit comments