Skip to content

Commit 9e0e80f

Browse files
authored
fix(preprint-make-decision): fixed preprint make decision button (#673)
1 parent e6d1e79 commit 9e0e80f

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ export class PreprintMakeDecisionComponent {
5959
decisionCommentLimit = InputLimits.decisionComment.maxLength;
6060

6161
labelDecisionButton = computed(() => {
62-
const preprint = this.preprint()!;
63-
if (preprint.reviewsState === ReviewsState.Withdrawn) {
62+
const preprint = this.preprint();
63+
if (preprint?.reviewsState === ReviewsState.Withdrawn) {
6464
return 'preprints.details.decision.withdrawalReason';
6565
} else if (this.isPendingWithdrawal()) {
6666
return 'preprints.details.decision.makeDecision';
6767
} else {
68-
return preprint.reviewsState === ReviewsState.Pending
68+
return preprint?.reviewsState === ReviewsState.Pending
6969
? 'preprints.details.decision.makeDecision'
7070
: 'preprints.details.decision.modifyDecision';
7171
}
@@ -78,14 +78,14 @@ export class PreprintMakeDecisionComponent {
7878
});
7979

8080
labelDecisionDialogHeader = computed(() => {
81-
const preprint = this.preprint()!;
81+
const preprint = this.preprint();
8282

83-
if (preprint.reviewsState === ReviewsState.Withdrawn) {
83+
if (preprint?.reviewsState === ReviewsState.Withdrawn) {
8484
return 'preprints.details.decision.header.withdrawalReason';
8585
} else if (this.isPendingWithdrawal()) {
8686
return 'preprints.details.decision.header.submitDecision';
8787
} else {
88-
return preprint.reviewsState === ReviewsState.Pending
88+
return preprint?.reviewsState === ReviewsState.Pending
8989
? 'preprints.details.decision.header.submitDecision'
9090
: 'preprints.details.decision.header.modifyDecision';
9191
}

src/app/features/preprints/pages/preprint-details/preprint-details.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,13 +261,12 @@ export class PreprintDetailsComponent implements OnInit, OnDestroy {
261261
);
262262
});
263263

264-
isOsfPreprint = computed(() => {
265-
return this.providerId() === 'osf';
266-
});
264+
isOsfPreprint = computed(() => this.providerId() === 'osf');
267265

268266
moderationStatusBannerVisible = computed(() => {
269267
return (
270268
this.moderationMode() &&
269+
this.preprint() &&
271270
!(
272271
this.isPreprintLoading() ||
273272
this.areReviewActionsLoading() ||
@@ -418,6 +417,7 @@ export class PreprintDetailsComponent implements OnInit, OnDestroy {
418417
this.router.navigate(['../', newPreprintId], {
419418
relativeTo: this.route,
420419
replaceUrl: true,
420+
queryParamsHandling: 'preserve',
421421
});
422422
}
423423
}

0 commit comments

Comments
 (0)