diff --git a/src/client/src/app/+state/events/actions/update-event.action.ts b/src/client/src/app/+state/events/actions/update-event.action.ts index 82ecc07..5042ade 100644 --- a/src/client/src/app/+state/events/actions/update-event.action.ts +++ b/src/client/src/app/+state/events/actions/update-event.action.ts @@ -49,7 +49,7 @@ async function updateEvent( eventId: props.eventId, body: { commit: props.commit ? props.commit : undefined, - externalUri: props.externalUri != undefined ? props.externalUri : undefined, + externalUri: props.externalUri ?? undefined, }, }); return response.ok diff --git a/src/client/src/app/components/events/event-details/event-details.component.ts b/src/client/src/app/components/events/event-details/event-details.component.ts index e6ffb12..c595adb 100644 --- a/src/client/src/app/components/events/event-details/event-details.component.ts +++ b/src/client/src/app/components/events/event-details/event-details.component.ts @@ -227,13 +227,16 @@ export class EventDetailsComponent { updateEventAction({ eventId: event.id, externalUri: - this.externalUri() != null ? (this.externalUri() as string | undefined) : undefined, + this.externalUri() ?? undefined, }) ); } protected openExternalUri() { - window.location.href = this.externalUri() as string; + const url = this.externalUri(); + if (url) { + window.location.href = url; + } } protected buildInstances() { diff --git a/src/client/src/app/components/events/event-details/modify-external-uri-dialog/modify-external-uri-dialog.component.ts b/src/client/src/app/components/events/event-details/modify-external-uri-dialog/modify-external-uri-dialog.component.ts index bd56330..1d7b2b4 100644 --- a/src/client/src/app/components/events/event-details/modify-external-uri-dialog/modify-external-uri-dialog.component.ts +++ b/src/client/src/app/components/events/event-details/modify-external-uri-dialog/modify-external-uri-dialog.component.ts @@ -43,7 +43,7 @@ export class ModifyExternalUriDialogComponent { protected readonly visible = signal(false); protected readonly externalUri = signal(''); - @ViewChild('inputElement') inputElement!: ElementRef; + private _inputElement = viewChild.required('inputElement', { read: ElementRef }); public open(currentValue: string | null | undefined) { this.visible.set(true); diff --git a/src/client/src/app/components/player-events/player-event-details/player-event-details.component.html b/src/client/src/app/components/player-events/player-event-details/player-event-details.component.html index 2d6fa06..d01d883 100644 --- a/src/client/src/app/components/player-events/player-event-details/player-event-details.component.html +++ b/src/client/src/app/components/player-events/player-event-details/player-event-details.component.html @@ -36,7 +36,7 @@ - @if (externalUri() && externalUri() !== null && externalUri()?.length !== 0) { + @if (externalUri()) {