From 3f75b299a0a71b9f4f3af9c982c2c10e20fdf079 Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 19 Jun 2020 14:41:53 +0200 Subject: [PATCH] Fix stuck ownership modal when the pad has been deleted --- www/common/common-ui-elements.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index abf98aa17..2b8e42790 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -3544,6 +3544,11 @@ define([ link ]); + var dismiss = function () { + common.mailbox.dismiss(data, function (err) { + console.log(err); + }); + }; var answer = function (yes) { common.mailbox.sendTo("ADD_OWNER_ANSWER", { channel: msg.content.channel, @@ -3555,9 +3560,7 @@ define([ channel: msg.content.user.notifications, curvePublic: msg.content.user.curvePublic }); - common.mailbox.dismiss(data, function (err) { - console.log(err); - }); + dismiss(); }; var todo = function (yes) { @@ -3572,6 +3575,8 @@ define([ if (err) { var text = err === "INSUFFICIENT_PERMISSIONS" ? Messages.fm_forbidden : Messages.error; + console.error(err); + dismiss(); return void UI.warn(text); } UI.log(Messages.saved);