diff --git a/web/projects/ui/src/app/routes/portal/components/logs/logs-fetch.directive.ts b/web/projects/ui/src/app/routes/portal/components/logs/logs-fetch.directive.ts index 0e6db0436..f118613ab 100644 --- a/web/projects/ui/src/app/routes/portal/components/logs/logs-fetch.directive.ts +++ b/web/projects/ui/src/app/routes/portal/components/logs/logs-fetch.directive.ts @@ -24,7 +24,11 @@ export class LogsFetchDirective { }), ), ), - tap(res => this.component.setCursor(res.startCursor)), + tap(res => { + if (res.startCursor) { + this.component.setCursor(res.startCursor) + } + }), map(({ entries }) => convertAnsi(entries)), catchError(e => { this.errors.handleError(e) diff --git a/web/projects/ui/src/app/routes/portal/components/logs/logs.component.ts b/web/projects/ui/src/app/routes/portal/components/logs/logs.component.ts index 4cde692b2..776ba1b3b 100644 --- a/web/projects/ui/src/app/routes/portal/components/logs/logs.component.ts +++ b/web/projects/ui/src/app/routes/portal/components/logs/logs.component.ts @@ -52,7 +52,7 @@ export class LogsComponent { @Input({ required: true }) context!: string scrollTop = 0 - startCursor?: string | null + startCursor?: string scroll = true loading = false previous: readonly string[] = [] diff --git a/web/projects/ui/src/app/routes/portal/components/logs/logs.pipe.ts b/web/projects/ui/src/app/routes/portal/components/logs/logs.pipe.ts index 233579826..49712a82b 100644 --- a/web/projects/ui/src/app/routes/portal/components/logs/logs.pipe.ts +++ b/web/projects/ui/src/app/routes/portal/components/logs/logs.pipe.ts @@ -45,7 +45,11 @@ export class LogsPipe implements PipeTransform { map(() => this.getMessage(true)), ), defer(() => followLogs(this.options)).pipe( - tap(r => this.logs.setCursor(r.startCursor)), + tap(r => { + if (r.startCursor) { + this.logs.setCursor(r.startCursor) + } + }), switchMap(r => this.api.openWebsocket$(r.guid, { openObserver: {