From 0405d406cca4fdc7b9e7f924cd1671510f13cd23 Mon Sep 17 00:00:00 2001 From: davy-c Date: Thu, 19 Dec 2019 12:09:20 +0900 Subject: [PATCH] fix --- .../NotePage/NoteDetail/NoteDetail.tsx | 60 ++++++++++++------- src/components/NotePage/NotePage.tsx | 3 +- 2 files changed, 39 insertions(+), 24 deletions(-) diff --git a/src/components/NotePage/NoteDetail/NoteDetail.tsx b/src/components/NotePage/NoteDetail/NoteDetail.tsx index f3b99de281..d049d63ac7 100644 --- a/src/components/NotePage/NoteDetail/NoteDetail.tsx +++ b/src/components/NotePage/NoteDetail/NoteDetail.tsx @@ -447,29 +447,43 @@ export default class NoteDetail extends React.Component< <>
- {this.props.breadCrumbs != null && - this.props.breadCrumbs - .map(breadCrumb => ( -
- {breadCrumb.folderLabel} -
- )) - .reduce((prev, curr) => ( - <> - {prev} -
- {curr} - - ))} +
+ All Notes +
+ {this.props.breadCrumbs != null && ( + <> +
+ {this.props.breadCrumbs + .map(breadCrumb => ( +
+ {breadCrumb.folderLabel} +
+ )) + .reduce((prev, curr) => ( + <> + {prev} +
+ {curr} + + ))} + + )}
diff --git a/src/components/NotePage/NotePage.tsx b/src/components/NotePage/NotePage.tsx index 1d4f64dd27..b726eac8b9 100644 --- a/src/components/NotePage/NotePage.tsx +++ b/src/components/NotePage/NotePage.tsx @@ -141,7 +141,8 @@ export default () => { }, [db, routeParams, storageId, setLastCreatedNoteId]) const breadCrumbs = useMemo(() => { - if (currentNote == null) return undefined + if (currentNote == null || currentNote.folderPathname === '/') + return undefined const folders = currentNote.folderPathname.substring(1).split('/') const thread = folders.map((folder, index) => { const folderPathname = `/${folders.slice(0, index + 1).join('/')}`