Add 'Store in drive' entry in file menu when the pad is only stored in a team #744

pull/1/head
yflory 4 years ago
parent 8af4a1d486
commit e60206a5ba

@ -2884,7 +2884,13 @@ define([
UIElements.displayStorePadPopup = function (common, data) { UIElements.displayStorePadPopup = function (common, data) {
if (storePopupState) { return; } if (storePopupState) { return; }
storePopupState = true; storePopupState = true;
if (data && data.stored) { return; } // We won't display the popup for dropped files // We won't display the popup for dropped files or already stored pads
if (data && data.stored) {
if (!data.inMyDrive) {
$('.cp-toolbar-storeindrive').show();
}
return;
}
var priv = common.getMetadataMgr().getPrivateData(); var priv = common.getMetadataMgr().getPrivateData();
// This pad will be deleted automatically, it shouldn't be stored // This pad will be deleted automatically, it shouldn't be stored

@ -1228,7 +1228,7 @@ define([
}); });
// Add the pad if it does not exist in our drive // Add the pad if it does not exist in our drive
if (!contains) { // || (ownedByMe && !inMyDrive)) { if (!contains || (data.forceSave && !inMyDrive)) {
var autoStore = Util.find(store.proxy, ['settings', 'general', 'autostore']); var autoStore = Util.find(store.proxy, ['settings', 'general', 'autostore']);
if (autoStore !== 1 && !data.forceSave && !data.path) { if (autoStore !== 1 && !data.forceSave && !data.path) {
// send event to inner to display the corner popup // send event to inner to display the corner popup
@ -1269,7 +1269,8 @@ define([
}); });
// Let inner know that dropped files shouldn't trigger the popup // Let inner know that dropped files shouldn't trigger the popup
postMessage(clientId, "AUTOSTORE_DISPLAY_POPUP", { postMessage(clientId, "AUTOSTORE_DISPLAY_POPUP", {
stored: true stored: true,
inMyDrive: inMyDrive
}); });
nThen(function (waitFor) { nThen(function (waitFor) {
sendTo.forEach(function (teamId) { sendTo.forEach(function (teamId) {

Loading…
Cancel
Save