Commit af31b27
authored
fix(dotcom): navigate away from file when leaving its group (tldraw#8930)
In order to avoid leaving the user stuck on a file they no longer have
access to, this PR makes `handleLeaveGroup` mirror `handleDeleteGroup`
in `GroupSettingsDialog`: if the user is viewing a file owned by the
group they just left, navigate them to `/`. Previously the sidebar
updated but the file stayed open until the next server-side access check
failed with `FORBIDDEN`.
Closes tldraw#8340
### Change type
- [x] `bugfix`
### Test plan
1. Be a member of a group that owns files.
2. Open a file belonging to that group.
3. Open group settings and leave the group.
4. You should be redirected away from the file instead of remaining on
it.
### Release notes
- Fix: redirect away from a group file when leaving the group.1 parent c437b2e commit af31b27
1 file changed
Lines changed: 5 additions & 0 deletions
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| 107 | + | |
| 108 | + | |
107 | 109 | | |
108 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
109 | 114 | | |
110 | 115 | | |
111 | 116 | | |
| |||
0 commit comments