fix: file picker dialog didn't survive failure of 'resolve_path' api

Massimo Melina committed Jun 15, 2022 at 23:05 UTC 0d4205d18f828120a27038482295cc9870eb566d
1 file changed +1 -2
admin/src/FilePicker.ts
+1 -2
@@ -38,8 +38,7 @@ export default function FilePicker({ onSelect, multiple=true, files=true, folder
38 apiCall('resolve_path', { path: from, closestFolder: true }).then(res => {
39 if (typeof res.path === 'string')
40 setCwd(res.path)
41 - setReady(true)
42 - })
41 + }).finally(() => setReady(true))
42 }, [from])
43 const { list, error, loading } = useApiList<DirEntry>(ready && 'ls', { path: cwd, files, fileMask })
44 useEffect(() => {