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 23, 2021
1 parent b92b298 commit c4393d2
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 @@ -60,7 +60,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 @@ -82,6 +82,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 c4393d2

Please sign in to comment.