mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 10:21:52 +00:00
fix: guard against null startCursor in logs component
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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[] = []
|
||||
|
||||
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user