From d6c299dcfda41ff6c355a9e5eee64d8f7734e030 Mon Sep 17 00:00:00 2001 From: ilkin-overleaf <100852799+ilkin-overleaf@users.noreply.github.com> Date: Fri, 21 Oct 2022 14:33:08 +0300 Subject: [PATCH] Merge pull request #10086 from overleaf/ii-dashboard-duplicate-projects [web] Project dashboard duplicate projects GitOrigin-RevId: ce21a1401769b694bf06a0a33c3d6684b407a47b --- .../web/app/src/Features/Project/ProjectListController.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/web/app/src/Features/Project/ProjectListController.js b/services/web/app/src/Features/Project/ProjectListController.js index fa4f9b243d..b24df18cd1 100644 --- a/services/web/app/src/Features/Project/ProjectListController.js +++ b/services/web/app/src/Features/Project/ProjectListController.js @@ -389,14 +389,14 @@ function _formatProjects(projects, userId) { // Only add these formattedProjects if they're not already present, this gives us cascading access // from 'owner' => 'token-read-only' for (const project of tokenReadAndWrite) { - if (!_.find(formattedProjects, ['id', project._id.toString()])) { + if (!formattedProjects.some(p => p.id === project._id.toString())) { formattedProjects.push( _formatProjectInfo(project, 'readAndWrite', Sources.TOKEN, userId) ) } } for (const project of tokenReadOnly) { - if (!_.find(formattedProjects, ['id', project._id.toString()])) { + if (!formattedProjects.some(p => p.id === project._id.toString())) { formattedProjects.push( _formatProjectInfo(project, 'readOnly', Sources.TOKEN, userId) ) @@ -458,7 +458,7 @@ function _formatProjectInfo(project, accessLevel, source, userId) { const trashed = ProjectHelper.isTrashed(project, userId) && !archived const model = { - id: project._id, + id: project._id.toString(), name: project.name, owner_ref: project.owner_ref, lastUpdated: project.lastUpdated,