fix: guard against null startCursor in logs component

This commit is contained in:
Aiden McClelland
2026-03-25 13:24:52 -06:00
parent cdbb512cca
commit 010e439d1d
3 changed files with 11 additions and 3 deletions

View File

@@ -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)

View File

@@ -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[] = []

View File

@@ -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$<T.LogEntry>(r.guid, {
openObserver: {