🐛 Fix issue with recent files not showing

This commit is contained in:
alonso.torres 2021-03-29 10:26:34 +02:00 committed by Andrey Antukh
parent 993530dbcb
commit 7d68d79fc3
3 changed files with 10 additions and 6 deletions

View file

@ -256,14 +256,17 @@
itemsize 290
ratio (if (some? @width) (/ @width itemsize) 0)
nitems (mth/floor ratio)
limit (if (and (some? @width)
(> (* itemsize (count files)) @width)
(< (- ratio nitems) 0.51))
(dec nitems) ;; Leave space for the "show all" block
nitems)
limit (min 10 ;; Configuration in backend to return recent files
(if (and (some? @width)
(> (* itemsize (count files)) @width)
(< (- ratio nitems) 0.51))
(dec nitems) ;; Leave space for the "show all" block
nitems))
limit (if dragging?
(dec limit)
limit)
limit (max 1 limit)]
(mf/use-effect