From f9de03440443666a2b40fe3f3b8a39e9a0edfa67 Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 28 Feb 2022 17:46:51 +0530 Subject: [PATCH] correctly detect when a pad is already stored in your personal drive to avoid creating duplicates --- www/common/outer/async-store.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/www/common/outer/async-store.js b/www/common/outer/async-store.js index 0f6db4db3..b59456fd0 100644 --- a/www/common/outer/async-store.js +++ b/www/common/outer/async-store.js @@ -1189,10 +1189,12 @@ define([ // we need to make a copy of this pad in our drive. We're going to check // if the pad is stored in our MAIN drive. // We only need to check this if the current manager is the target (data.teamId) - if (data.teamId === Number(s.id)) { - inMyDrive = res.some(function (obj) { - return !obj.fId; - }); + if ((!s.id && !data.teamId) || Number(s.id) === data.teamId) { + if (!inMyDrive) { + inMyDrive = res.some(function (obj) { + return !obj.fId; + }); + } } Array.prototype.push.apply(allData, res);