mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-14 11:05:41 +05:00
correctly detect when a pad is already stored in your personal drive
to avoid creating duplicates
This commit is contained in:
parent
4019ec0880
commit
f9de034404
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user