mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +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)),
|
map(({ entries }) => convertAnsi(entries)),
|
||||||
catchError(e => {
|
catchError(e => {
|
||||||
this.errors.handleError(e)
|
this.errors.handleError(e)
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ export class LogsComponent {
|
|||||||
@Input({ required: true }) context!: string
|
@Input({ required: true }) context!: string
|
||||||
|
|
||||||
scrollTop = 0
|
scrollTop = 0
|
||||||
startCursor?: string | null
|
startCursor?: string
|
||||||
scroll = true
|
scroll = true
|
||||||
loading = false
|
loading = false
|
||||||
previous: readonly string[] = []
|
previous: readonly string[] = []
|
||||||
|
|||||||
@@ -45,7 +45,11 @@ export class LogsPipe implements PipeTransform {
|
|||||||
map(() => this.getMessage(true)),
|
map(() => this.getMessage(true)),
|
||||||
),
|
),
|
||||||
defer(() => followLogs(this.options)).pipe(
|
defer(() => followLogs(this.options)).pipe(
|
||||||
tap(r => this.logs.setCursor(r.startCursor)),
|
tap(r => {
|
||||||
|
if (r.startCursor) {
|
||||||
|
this.logs.setCursor(r.startCursor)
|
||||||
|
}
|
||||||
|
}),
|
||||||
switchMap(r =>
|
switchMap(r =>
|
||||||
this.api.openWebsocket$<T.LogEntry>(r.guid, {
|
this.api.openWebsocket$<T.LogEntry>(r.guid, {
|
||||||
openObserver: {
|
openObserver: {
|
||||||
|
|||||||
Reference in New Issue
Block a user