Skip to content

Commit

Permalink
Fix NotebookList stuck when Notebook is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
Kévin Commaille committed Feb 22, 2021
1 parent 183b309 commit fc0d87f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/screens/NotebookListScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default function NotebookListScreen(props: PropsType) {
<RightAction colUid={notebook?.uid} />
),
});
}, [active, navigation, notebook]);
}, [active, colUid, navigation, notebook]);

const onBackPress = React.useCallback(() => {
if (active && notebook) {
Expand All @@ -87,6 +87,10 @@ export default function NotebookListScreen(props: PropsType) {
}

if (colUid && !cacheCollection) {
navigation.setOptions({
title: "Not Found",
headerLeft: () => <PaperAppbar.BackAction onPress={() => navigation.navigate("Home", { colUid: "" })} />,
});
return <NotFound />;
}

Expand Down

0 comments on commit fc0d87f

Please sign in to comment.