Merge pull request #15289 from roxanneskelly/Case20499

Case 20499 - Scripts that use AppUI don't call `that.onClosed()` if the script is restarted while the app is open
This commit is contained in:
Shannon Romano 2019-03-29 17:05:21 -07:00 committed by GitHub
commit c5e7c63d38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -353,10 +353,11 @@ function AppUi(properties) {
// Close if necessary, clean up any remaining handlers, and remove the button.
GlobalServices.myUsernameChanged.disconnect(restartNotificationPoll);
GlobalServices.findableByChanged.disconnect(restartNotificationPoll);
that.tablet.screenChanged.disconnect(that.onScreenChanged);
if (that.isOpen) {
that.close();
that.onScreenChanged("", "");
}
that.tablet.screenChanged.disconnect(that.onScreenChanged);
if (that.button) {
if (that.onClicked) {
that.button.clicked.disconnect(that.onClicked);