Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ public async Task<DownloadProjectByCodeResult> DownloadProjectByCode(string code
{
var (status, projectId) = await lexboxProjectService.GetLexboxProjectId(server, code);
if (status != DownloadProjectByCodeResult.Success) return status;
// Note: the project might be from a different server, but that's current only relevant for devs
// and we still can't download two projects with the same code
if (crdtProjectsService.ProjectExists(code)) return DownloadProjectByCodeResult.ProjectAlreadyDownloaded;
var role = userRole.HasValue ? FromRole(userRole.Value) : ProjectRole.Editor;
project = new ProjectModel(
Expand Down
2 changes: 1 addition & 1 deletion frontend/viewer/src/home/Server.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
}

function validateCodeForDownload(projectCode: string): string | undefined {
if (localProjects.some(p => p.code === projectCode)) {
if (localProjects.some(p => p.code === projectCode && p.server?.id === server?.id)) {
return $t`You have already downloaded the ${projectCode} project`;
}
}
Expand Down
Loading