Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,14 @@ export class PreprintStepperState {

ctx.setState(patch({ preprintFile: patch({ isLoading: true }) }));

return this.fileService
.updateFileContent(action.file, uploadedFile.links.upload)
.pipe(switchMap(() => this.fileService.renameEntry(uploadedFile.links.upload, action.file.name, 'replace')));
return this.fileService.updateFileContent(action.file, uploadedFile.links.upload).pipe(
switchMap(() => {
if (uploadedFile.name !== action.file.name) {
return this.fileService.renameEntry(uploadedFile.links.upload, action.file.name, 'replace');
}
return EMPTY;
})
);
}

@Action(FetchPreprintPrimaryFile)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ describe('ProjectOverviewToolbarComponent', () => {
expect(component.ResourceType).toBe(ResourceType);
});

it('should have resourceType set to Registration', () => {
expect(component.resourceType).toBe(ResourceType.Registration);
it('should have resourceType set to Project', () => {
expect(component.resourceType).toBe(ResourceType.Project);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class ProjectOverviewToolbarComponent {

isPublic = signal(false);
isBookmarked = signal(false);
resourceType = ResourceType.Registration;
resourceType = ResourceType.Project;

bookmarksCollectionId = select(BookmarksSelectors.getBookmarksCollectionId);
bookmarks = select(BookmarksSelectors.getBookmarks);
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3064,6 +3064,7 @@
"registration_approved_no_user": "Registration of {{node}} was approved",
"registration_cancelled": "{{user}} cancelled a registration of {{node}}",
"registration_initiated": "{{user}} initiated a registration of {{node}}",
"registration_date_updated": "An OSF Support Team member updated the registration date of {{node}}",
"resource_identifier_added": "{{user}} has added a Resource to Registration {{node}}",
"resource_identifier_removed": "{{user}} has removed a Resource to Registration {{node}}",
"resource_identifier_updated": "{{user}} has updated a Resource to Registration {{node}}",
Expand Down