Skip to content

Allow uploading multiple files#11687

Merged
balloob merged 4 commits intodevfrom
allow-upload-multiple
Feb 14, 2022
Merged

Allow uploading multiple files#11687
balloob merged 4 commits intodevfrom
allow-upload-multiple

Conversation

@balloob
Copy link
Copy Markdown
Member

@balloob balloob commented Feb 14, 2022

Breaking change

Proposed change

  • Fix styling of the upload button
  • Allow uploading multiple files
  • Show upload progress on button
  • Highlight add media button when no local media found
CleanShot.2022-02-14.at.10.22.34.mp4

image

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@matthiasdebaat
Copy link
Copy Markdown
Member

Really nice! When uploading, can we make the icon into an animated spinner?

@balloob
Copy link
Copy Markdown
Member Author

balloob commented Feb 14, 2022

done.

CleanShot.2022-02-14.at.10.54.29.mp4

const files = input.files!;
const target = this._currentItem!.media_content_id!;

try {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What will this try catch, as the try inside the loop will catch everything?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use it for the finally.

Copy link
Copy Markdown
Member

@bramkragten bramkragten Feb 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The finally isn't needed then right? If it will not throw anyway?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if an error happens in the inner try, we do a return.

So now in both error case + when finished will we set uploading to 0 and refresh.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why return and not break?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know 😄

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@balloob balloob force-pushed the allow-upload-multiple branch from fc192d9 to e0e6ac5 Compare February 14, 2022 23:07
@balloob balloob enabled auto-merge (squash) February 14, 2022 23:21
@balloob balloob merged commit 8bb2374 into dev Feb 14, 2022
@delete-merged-branch delete-merged-branch bot deleted the allow-upload-multiple branch February 14, 2022 23:25
@github-actions github-actions bot locked and limited conversation to collaborators Feb 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants