From 22a2b85faebb1b5cf0a086fb4c4793338701ae97 Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 20 Apr 2020 18:14:38 +0200 Subject: [PATCH] Fix broken share modal --- www/common/sframe-common-outer.js | 1 - www/secureiframe/inner.js | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/www/common/sframe-common-outer.js b/www/common/sframe-common-outer.js index 8cddefb9f..b7bfcbc67 100644 --- a/www/common/sframe-common-outer.js +++ b/www/common/sframe-common-outer.js @@ -1001,7 +1001,6 @@ define([ config.onAction = function (data) { if (typeof(SecureModal.cb) !== "function") { return; } SecureModal.cb(data); - SecureModal.$iframe.hide(); }; config.onClose = function () { SecureModal.$iframe.hide(); diff --git a/www/secureiframe/inner.js b/www/secureiframe/inner.js index 86b488fe4..2c39943cc 100644 --- a/www/secureiframe/inner.js +++ b/www/secureiframe/inner.js @@ -35,6 +35,7 @@ define([ var $body = $('body'); var hideIframe = function () { + if (!displayed) { return; } sframeChan.event('EV_SECURE_IFRAME_CLOSE'); }; @@ -68,7 +69,6 @@ define([ password: priv.password } }); - $('button.cancel').click(); // Close any existing alertify _modal = UI.openCustomModal(modal); displayed = modal; }; @@ -237,6 +237,7 @@ define([ if (!create[type]) { return; } if (displayed && displayed.close) { displayed.close(); } else if (displayed && displayed.hide) { displayed.hide(); } + $('button.cancel').click(); // Close any existing alertify displayed = undefined; create[type](data); });