diff --git a/src/app/features/preprints/components/preprint-details/preprint-make-decision/preprint-make-decision.component.ts b/src/app/features/preprints/components/preprint-details/preprint-make-decision/preprint-make-decision.component.ts index 0bb81f382..3b1858e5d 100644 --- a/src/app/features/preprints/components/preprint-details/preprint-make-decision/preprint-make-decision.component.ts +++ b/src/app/features/preprints/components/preprint-details/preprint-make-decision/preprint-make-decision.component.ts @@ -59,13 +59,13 @@ export class PreprintMakeDecisionComponent { decisionCommentLimit = InputLimits.decisionComment.maxLength; labelDecisionButton = computed(() => { - const preprint = this.preprint()!; - if (preprint.reviewsState === ReviewsState.Withdrawn) { + const preprint = this.preprint(); + if (preprint?.reviewsState === ReviewsState.Withdrawn) { return 'preprints.details.decision.withdrawalReason'; } else if (this.isPendingWithdrawal()) { return 'preprints.details.decision.makeDecision'; } else { - return preprint.reviewsState === ReviewsState.Pending + return preprint?.reviewsState === ReviewsState.Pending ? 'preprints.details.decision.makeDecision' : 'preprints.details.decision.modifyDecision'; } @@ -78,14 +78,14 @@ export class PreprintMakeDecisionComponent { }); labelDecisionDialogHeader = computed(() => { - const preprint = this.preprint()!; + const preprint = this.preprint(); - if (preprint.reviewsState === ReviewsState.Withdrawn) { + if (preprint?.reviewsState === ReviewsState.Withdrawn) { return 'preprints.details.decision.header.withdrawalReason'; } else if (this.isPendingWithdrawal()) { return 'preprints.details.decision.header.submitDecision'; } else { - return preprint.reviewsState === ReviewsState.Pending + return preprint?.reviewsState === ReviewsState.Pending ? 'preprints.details.decision.header.submitDecision' : 'preprints.details.decision.header.modifyDecision'; } diff --git a/src/app/features/preprints/pages/preprint-details/preprint-details.component.ts b/src/app/features/preprints/pages/preprint-details/preprint-details.component.ts index 931bdcfa9..780815bd3 100644 --- a/src/app/features/preprints/pages/preprint-details/preprint-details.component.ts +++ b/src/app/features/preprints/pages/preprint-details/preprint-details.component.ts @@ -261,13 +261,12 @@ export class PreprintDetailsComponent implements OnInit, OnDestroy { ); }); - isOsfPreprint = computed(() => { - return this.providerId() === 'osf'; - }); + isOsfPreprint = computed(() => this.providerId() === 'osf'); moderationStatusBannerVisible = computed(() => { return ( this.moderationMode() && + this.preprint() && !( this.isPreprintLoading() || this.areReviewActionsLoading() || @@ -418,6 +417,7 @@ export class PreprintDetailsComponent implements OnInit, OnDestroy { this.router.navigate(['../', newPreprintId], { relativeTo: this.route, replaceUrl: true, + queryParamsHandling: 'preserve', }); } }