Closed harsh-tamr closed 3 years ago
Fixes: https://github.com/uptick/react-keyed-file-browser/issues/115
If your files look like /a/b/c.txt, /a/b/d.txt, then you will get undefined for the folder calls because no folders have been defined.
/a/b/c.txt, /a/b/d.txt
If you have /a/, a/b/, /a/b/c.txt, /a/b/d.txt then you will get the folder you are looking for.
/a/, a/b/, /a/b/c.txt, /a/b/d.txt
The problem lies in https://github.com/uptick/react-keyed-file-browser/blob/master/src/browser.js#L178 where .find is looking for an exact match in all the files.
I would argue that a user should not have to specify all the folders and if a prefix exists. The onSelect callback should return a folder with 0 for modified and size.
@bor3ham @scaredcat @roymfibo @jlo-1
Fixes: https://github.com/uptick/react-keyed-file-browser/issues/115
If your files look like
/a/b/c.txt, /a/b/d.txt
, then you will get undefined for the folder calls because no folders have been defined.If you have
/a/, a/b/, /a/b/c.txt, /a/b/d.txt
then you will get the folder you are looking for.The problem lies in https://github.com/uptick/react-keyed-file-browser/blob/master/src/browser.js#L178 where .find is looking for an exact match in all the files.
I would argue that a user should not have to specify all the folders and if a prefix exists. The onSelect callback should return a folder with 0 for modified and size.