Skip to content

Commit

Permalink
feat: order file uploads slots by most recent
Browse files Browse the repository at this point in the history
- As per Jess's comment: #2335 (review)
- Small change to flip the ordering of slots so that the most recent is at the top
  • Loading branch information
Mike-Heneghan committed Oct 26, 2023
1 parent d3e9421 commit ef302e5
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 ef302e5

Please sign in to comment.