From afa799867a28b8baa5cac925f50dec7dd8131785 Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 28 Feb 2022 14:31:10 +0100 Subject: [PATCH] Fix 'store in cryptdrive' displayed when creating a pad from the drive --- www/common/outer/async-store.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/www/common/outer/async-store.js b/www/common/outer/async-store.js index 2726e9c83..e2073835d 100644 --- a/www/common/outer/async-store.js +++ b/www/common/outer/async-store.js @@ -1170,7 +1170,7 @@ define([ // If it is stored, update its data, otherwise ask the user if they want to store it var allData = []; var sendTo = []; - var inTargetDrive; + var inTargetDrive, inMyDrive; getAllStores().forEach(function (s) { // If this is an edit link but we don't have edit rights, this entry is not useful if (h.mode === "edit" && s.id && !s.secondaryKey) { @@ -1189,6 +1189,8 @@ define([ } } + if (!s.id) { inMyDrive = res.length; } + Array.prototype.push.apply(allData, res); }); var contains = allData.length !== 0; @@ -1253,7 +1255,7 @@ define([ // Let inner know that dropped files shouldn't trigger the popup postMessage(clientId, "AUTOSTORE_DISPLAY_POPUP", { stored: true, - inMyDrive: !contains && data.teamId // display "store in cryptdrive" entry + inMyDrive: inMyDrive || (!contains && !data.teamId) // display "store in cryptdrive" entry }); return; } @@ -1268,7 +1270,7 @@ define([ // Let inner know that dropped files shouldn't trigger the popup postMessage(clientId, "AUTOSTORE_DISPLAY_POPUP", { stored: true, - inMyDrive: true + inMyDrive: inMyDrive }); nThen(function (waitFor) { sendTo.forEach(function (teamId) {