Skip to content

Commit cd2755a

Browse files
authored
Merge pull request #1731 from nextcloud-libraries/chore/deprecate-dialog-hide
chore: deprecate `Dialog.hide`
2 parents 410a0c7 + 88ead93 commit cd2755a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ All notable changes to this project will be documented in this file.
1212
The export of the file picker Vue component is deprecated and will be removed in the next version.
1313
Instead please use the `FilePickerBuilder`.
1414

15+
The `Dialog.hide` method is deprecated.
16+
Instead only user interaction should close dialogs,
17+
for this use the promise returned by `Dialog.show` which will resolve if the user answered the dialog and rejected if the user aborted (closed) the dialog.
18+
1519
## 6.1.1
1620
[Full Changelog](https://github.com/nextcloud-libraries/nextcloud-dialogs/compare/v6.1.0...v6.1.1)
1721

lib/dialogs.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export class Dialog {
5454
* Spawn and show the dialog - if already open the previous instance will be destroyed
5555
* @return Promise that resolves when the dialog is answered successfully and rejects on close
5656
*/
57-
show() {
57+
async show() {
5858
if (this.#dialog) {
5959
this.#dialog.$destroy()
6060
}
@@ -75,6 +75,8 @@ export class Dialog {
7575

7676
/**
7777
* Hide and destroy the current dialog instance
78+
*
79+
* @deprecated use the promise of the `show` methods for the user interaction.
7880
*/
7981
hide() {
8082
this.#dialog?.$destroy()

0 commit comments

Comments
 (0)