Skip to content

Commit

Permalink
fix: wait for router.push to complete before reloading (#1323)
Browse files Browse the repository at this point in the history
  • Loading branch information
fontanierh authored Sep 8, 2023
1 parent bfeef0f commit bbb3f97
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions front/components/sparkle/AppLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@ function NavigationBar({
readOnly={false}
onWorkspaceUpdate={(workspace) => {
if (workspace.id !== owner.id) {
void router.push(`/w/${workspace.sId}/u/chat`);
void router.reload();
void router
.push(`/w/${workspace.sId}/u/chat`)
.then(() => router.reload());
}
}}
/>
Expand Down

0 comments on commit bbb3f97

Please sign in to comment.