mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #10086 from overleaf/ii-dashboard-duplicate-projects
[web] Project dashboard duplicate projects GitOrigin-RevId: ce21a1401769b694bf06a0a33c3d6684b407a47b
This commit is contained in:
parent
f8e98cd5c6
commit
185ccde5a0
1 changed files with 3 additions and 3 deletions
|
@ -389,14 +389,14 @@ function _formatProjects(projects, userId) {
|
||||||
// Only add these formattedProjects if they're not already present, this gives us cascading access
|
// Only add these formattedProjects if they're not already present, this gives us cascading access
|
||||||
// from 'owner' => 'token-read-only'
|
// from 'owner' => 'token-read-only'
|
||||||
for (const project of tokenReadAndWrite) {
|
for (const project of tokenReadAndWrite) {
|
||||||
if (!_.find(formattedProjects, ['id', project._id.toString()])) {
|
if (!formattedProjects.some(p => p.id === project._id.toString())) {
|
||||||
formattedProjects.push(
|
formattedProjects.push(
|
||||||
_formatProjectInfo(project, 'readAndWrite', Sources.TOKEN, userId)
|
_formatProjectInfo(project, 'readAndWrite', Sources.TOKEN, userId)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (const project of tokenReadOnly) {
|
for (const project of tokenReadOnly) {
|
||||||
if (!_.find(formattedProjects, ['id', project._id.toString()])) {
|
if (!formattedProjects.some(p => p.id === project._id.toString())) {
|
||||||
formattedProjects.push(
|
formattedProjects.push(
|
||||||
_formatProjectInfo(project, 'readOnly', Sources.TOKEN, userId)
|
_formatProjectInfo(project, 'readOnly', Sources.TOKEN, userId)
|
||||||
)
|
)
|
||||||
|
@ -458,7 +458,7 @@ function _formatProjectInfo(project, accessLevel, source, userId) {
|
||||||
const trashed = ProjectHelper.isTrashed(project, userId) && !archived
|
const trashed = ProjectHelper.isTrashed(project, userId) && !archived
|
||||||
|
|
||||||
const model = {
|
const model = {
|
||||||
id: project._id,
|
id: project._id.toString(),
|
||||||
name: project.name,
|
name: project.name,
|
||||||
owner_ref: project.owner_ref,
|
owner_ref: project.owner_ref,
|
||||||
lastUpdated: project.lastUpdated,
|
lastUpdated: project.lastUpdated,
|
||||||
|
|
Loading…
Reference in a new issue