Fix stuck ownership modal when the pad has been deleted

pull/1/head
yflory 5 years ago
parent cc242965dc
commit 3f75b299a0

@ -3544,6 +3544,11 @@ define([
link link
]); ]);
var dismiss = function () {
common.mailbox.dismiss(data, function (err) {
console.log(err);
});
};
var answer = function (yes) { var answer = function (yes) {
common.mailbox.sendTo("ADD_OWNER_ANSWER", { common.mailbox.sendTo("ADD_OWNER_ANSWER", {
channel: msg.content.channel, channel: msg.content.channel,
@ -3555,9 +3560,7 @@ define([
channel: msg.content.user.notifications, channel: msg.content.user.notifications,
curvePublic: msg.content.user.curvePublic curvePublic: msg.content.user.curvePublic
}); });
common.mailbox.dismiss(data, function (err) { dismiss();
console.log(err);
});
}; };
var todo = function (yes) { var todo = function (yes) {
@ -3572,6 +3575,8 @@ define([
if (err) { if (err) {
var text = err === "INSUFFICIENT_PERMISSIONS" ? Messages.fm_forbidden var text = err === "INSUFFICIENT_PERMISSIONS" ? Messages.fm_forbidden
: Messages.error; : Messages.error;
console.error(err);
dismiss();
return void UI.warn(text); return void UI.warn(text);
} }
UI.log(Messages.saved); UI.log(Messages.saved);

Loading…
Cancel
Save