Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(FilePicker): Stop default close event in case of button press #1207

Merged
merged 1 commit into from Jan 26, 2024

Conversation

susnux
Copy link
Contributor

@susnux susnux commented Jan 25, 2024

If you press a button NcDialog will call the filepicker callback and afterwards close the dialog.
But our callback is async and NcDialog does not await the callback.

This means sometimes the close event with picked nodes is not emitted first but the close from NcDialog.

So what I do now:

  1. On button press (now synchronous function) lock the close event
  2. Call the callback
  3. Emit only one close (that with the picked nodes)
  4. Unlock the close event

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux susnux added bug Something isn't working 3. to review labels Jan 25, 2024
Copy link
Contributor

@Pytal Pytal left a comment

Choose a reason for hiding this comment

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

Would adding an awaited callback to the API make sense?

@susnux
Copy link
Contributor Author

susnux commented Jan 25, 2024

Would adding an awaited callback to the API make sense?

Yes but we need a solution for now. We can do later as otherwise we force every library user to upgrade nextcloud vue. Including stable27

@skjnldsv skjnldsv merged commit ed4aa01 into main Jan 26, 2024
10 checks passed
@skjnldsv skjnldsv deleted the fix/emite-on-close branch January 26, 2024 11:31
@susnux
Copy link
Contributor Author

susnux commented Apr 12, 2024

/backport to stable4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Move or copy files and folders fails
4 participants