From 07dfcf4effbff6eff9e623ff0c9ae74539df105b Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Sun, 5 Mar 2023 20:00:42 -0500 Subject: [PATCH] endSessionDialog: Don't emit 'closed' until handler is connected Prior to commit 7bd98f3f5fb7e0d1220646b8a4ee7073534a8e8f animation onComplete handlers always occured at least after one main loop iteration. Now, if animations are disabled, they can get invoked immediately. That breaks the endSessionDialog button handler, which calls close before setting up the "closed" signal handler. This commit fixes the handler to get set up first. Part-of: --- js/ui/endSessionDialog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/ui/endSessionDialog.js b/js/ui/endSessionDialog.js index ca24d0698..66fc2e6f9 100644 --- a/js/ui/endSessionDialog.js +++ b/js/ui/endSessionDialog.js @@ -447,11 +447,11 @@ class EndSessionDialog extends ModalDialog.ModalDialog { let label = dialogContent.confirmButtons[i].label; let button = this.addButton({ action: () => { - this.close(true); let signalId = this.connect('closed', () => { this.disconnect(signalId); this._confirm(signal); }); + this.close(true); }, label, });