Skip to content

Commit 82a96ac

Browse files
committed
fix(mobile): clear the settings project filter after removing that project
1 parent e289208 commit 82a96ac

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

‎apps/mobile/src/features/settings/SettingsProjectOverviewRouteScreen.tsx‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ function ProjectOverviewContent(props: {
110110
const [draftName, setDraftName] = useState<string | null>(null);
111111
const [isSaving, setIsSaving] = useState(false);
112112
const navigation = useNavigation();
113+
const { selectProject } = useSettingsEnvironmentFilter();
113114
const threads = useThreadShells();
114115
const removableEnvironments = useEnvironmentsWithScope(
115116
props.members,
@@ -197,8 +198,12 @@ function ProjectOverviewContent(props: {
197198
console.warn("[project-removal] could not clear composer drafts", error);
198199
});
199200
}
200-
// Nothing is left to show once the whole project is gone.
201-
if (plan.targetKind === "project" && navigation.isFocused()) navigation.goBack();
201+
// Nothing is left to show once the whole project is gone, and its filter would
202+
// otherwise keep pointing at it as an unavailable project.
203+
if (plan.targetKind === "project") {
204+
if (navigation.isFocused()) navigation.goBack();
205+
selectProject(null);
206+
}
202207
})().finally(finishRemoval);
203208
},
204209
});

0 commit comments

Comments
 (0)