Skip to content

Commit

Permalink
feat: first pass reordering uploaded files to show most recent first (#…
Browse files Browse the repository at this point in the history
…2335)

* feat: order file uploads slots by most recent

- As per Jess's comment: #2335 (review)
- Small change to flip the ordering of slots so that the most recently uploaded file is at the top
  • Loading branch information
Mike-Heneghan authored Oct 27, 2023
1 parent 6693053 commit c97f0f4
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ function Component(props: Props) {
const previousSlotCount = usePrevious(slots.length);
useEffect(() => {
if (previousSlotCount === undefined) return;

// Show most recent upload at the top
if (slots.length) setSlots(slots.reverse());

// Only stop modal opening on initial return to node
if (isUserReturningToNode) return setIsUserReturningToNode(false);
if (slots.length && dropzoneError) setDropzoneError(undefined);
Expand Down

0 comments on commit c97f0f4

Please sign in to comment.