Fix autostore not displaying the error message when over pin limit

pull/1/head
yflory 6 years ago
parent c1ef8243a1
commit 179df27e3c

@ -113,6 +113,7 @@
padding: 5px; padding: 5px;
color: @colortheme_base; color: @colortheme_base;
margin-left: 5px; margin-left: 5px;
outline: none;
&.cp-corner-primary { &.cp-corner-primary {
background-color: @corner-button-ok; background-color: @corner-button-ok;
font-weight: bold; font-weight: bold;

@ -2396,13 +2396,16 @@ define([
modal.delete(); modal.delete();
}); });
$(store).click(function () { $(store).click(function () {
UIElements.displayCrowdfunding(common);
modal.delete();
common.getSframeChannel().query("Q_AUTOSTORE_STORE", null, function (err, obj) { common.getSframeChannel().query("Q_AUTOSTORE_STORE", null, function (err, obj) {
if (err || (obj && obj.error)) { var error = err || (obj && obj.error);
console.error(err || obj.error); if (error) {
if (error === 'E_OVER_LIMIT') {
return void UI.warn(Messages.pinLimitReached);
}
return void UI.warn(Messages.autostore_error); return void UI.warn(Messages.autostore_error);
} }
modal.delete();
UIElements.displayCrowdfunding(common);
UI.log(Messages.autostore_saved); UI.log(Messages.autostore_saved);
}); });
}); });

@ -345,6 +345,9 @@ define([
}; };
common.getPadAttribute = function (attr, cb, href) { common.getPadAttribute = function (attr, cb, href) {
href = Hash.getRelativeHref(href || window.location.href); href = Hash.getRelativeHref(href || window.location.href);
if (!href) {
return void cb('E404');
}
postMessage("GET_PAD_ATTRIBUTE", { postMessage("GET_PAD_ATTRIBUTE", {
href: href, href: href,
attr: attr, attr: attr,

@ -465,7 +465,7 @@ define([
if (data.password) { pad.password = data.password; } if (data.password) { pad.password = data.password; }
if (data.channel) { pad.channel = data.channel; } if (data.channel) { pad.channel = data.channel; }
store.manager.addPad(data.path, pad, function (e) { store.manager.addPad(data.path, pad, function (e) {
if (e) { return void cb({error: "Error while adding the pad:"+ e}); } if (e) { return void cb({error: e}); }
sendDriveEvent('DRIVE_CHANGE', { sendDriveEvent('DRIVE_CHANGE', {
path: ['drive', UserObject.FILES_DATA] path: ['drive', UserObject.FILES_DATA]
}, clientId); }, clientId);

@ -371,7 +371,7 @@ define([
forceSave: true forceSave: true
}; };
Cryptpad.setPadTitle(data, function (err) { Cryptpad.setPadTitle(data, function (err) {
cb(err); cb({error: err});
}); });
}); });
sframeChan.on('Q_IS_PAD_STORED', function (data, cb) { sframeChan.on('Q_IS_PAD_STORED', function (data, cb) {

@ -107,6 +107,7 @@
.cp-app-slide-viewer { .cp-app-slide-viewer {
width: 50vw; width: 50vw;
overflow: hidden; overflow: hidden;
z-index: 998;
div#cp-app-slide-modal:not(.cp-app-slide-shown) { div#cp-app-slide-modal:not(.cp-app-slide-shown) {
position: relative; position: relative;
top: auto; top: auto;

Loading…
Cancel
Save