Don't ask for password when receiving a pad from the notifications

pull/1/head
yflory 6 years ago
parent 7a0f30488c
commit 520655856b

@ -57,7 +57,12 @@ define([
.html(Messages._getKey(key, [msg.content.name || Messages.anonymous, msg.content.title]));
$(el).find('.cp-notification-content').addClass("cp-clickable")
.click(function () {
common.openURL(msg.content.href);
var todo = function () { common.openURL(msg.content.href); };
if (!msg.content.password) { return void todo(); }
common.getSframeChannel().query('Q_SESSIONSTORAGE_PUT', {
key: 'newPadPassword',
value: msg.content.password
}, todo);
});
$(el).find('.cp-notification-dismiss').css('display', 'flex');
};

@ -223,6 +223,11 @@ define([
sframeChan.event("EV_PAD_PASSWORD");
};
if (!val && sessionStorage.newPadPassword) {
val = sessionStorage.newPadPassword;
delete sessionStorage.newPadPassword;
}
if (val) {
password = val;
Cryptpad.getFileSize(window.location.href, password, waitFor(function (e, size) {

Loading…
Cancel
Save