Skip to content

Commit 20e6df2

Browse files
committed
fix the file not found page
1 parent 282fef3 commit 20e6df2

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/files/FilesPage.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,14 @@ const FilesPage = ({
197197
, [files?.content, files?.pins, selected])
198198

199199
if (!files || files.type === 'file') return null
200-
200+
// if file not found
201+
if (files.type === 'not-found') {
202+
return <FileNotFound path={files.path} />
203+
}
201204
// Don't render stale content during navigation
202205
if (files.path && filesPathInfo.path && files.path !== filesPathInfo.path) {
203206
return null
204207
}
205-
206208
if (files.type === 'unknown') {
207209
const path = files.path
208210

@@ -214,10 +216,6 @@ const FilesPage = ({
214216
</div>
215217
)
216218
}
217-
if (files.type === 'not-found') {
218-
return <FileNotFound path={files.path} />
219-
}
220-
221219
const commonProps = {
222220
updateSorting: doFilesUpdateSorting,
223221
files: files.content || [],

0 commit comments

Comments
 (0)