Skip to content

Commit d9cef38

Browse files
committed
fix(preprints): fixed withdrawn preprint issue
1 parent 1a6ce9d commit d9cef38

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

src/app/features/preprints/components/preprint-details/preprint-tombstone/preprint-tombstone.component.ts

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,18 @@ import { Card } from 'primeng/card';
66
import { Skeleton } from 'primeng/skeleton';
77
import { Tag } from 'primeng/tag';
88

9-
import { DatePipe } from '@angular/common';
10-
import { ChangeDetectionStrategy, Component, computed, effect, inject, input, OnDestroy, output } from '@angular/core';
9+
import { DatePipe, isPlatformBrowser } from '@angular/common';
10+
import {
11+
ChangeDetectionStrategy,
12+
Component,
13+
computed,
14+
effect,
15+
inject,
16+
input,
17+
OnDestroy,
18+
output,
19+
PLATFORM_ID,
20+
} from '@angular/core';
1121
import { Router } from '@angular/router';
1222

1323
import { ApplicabilityStatus, PreregLinkInfo } from '@osf/features/preprints/enums';
@@ -57,6 +67,8 @@ export class PreprintTombstoneComponent implements OnDestroy {
5767
});
5868
private router = inject(Router);
5969

70+
private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
71+
6072
preprintVersionSelected = output<string>();
6173

6274
preprintProvider = input.required<PreprintProviderDetails | undefined>();
@@ -91,7 +103,9 @@ export class PreprintTombstoneComponent implements OnDestroy {
91103
}
92104

93105
ngOnDestroy(): void {
94-
this.actions.resetContributorsState();
106+
if (this.isBrowser) {
107+
this.actions.resetContributorsState();
108+
}
95109
}
96110

97111
tagClicked(tag: string) {

0 commit comments

Comments
 (0)