From d480c6a437595c8136532dd5e86140f478f76733 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 10 Dec 2024 11:15:48 +0100 Subject: [PATCH] Prevent loading undefined job state --- client/src/app/+admin/system/jobs/jobs.component.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/src/app/+admin/system/jobs/jobs.component.ts b/client/src/app/+admin/system/jobs/jobs.component.ts index 52c373a59..879dfae3e 100644 --- a/client/src/app/+admin/system/jobs/jobs.component.ts +++ b/client/src/app/+admin/system/jobs/jobs.component.ts @@ -41,7 +41,7 @@ export class JobsComponent extends RestTable implements OnInit { private static LS_STATE = 'jobs-list-state' private static LS_TYPE = 'jobs-list-type' - jobState?: JobStateClient + jobState: JobStateClient = 'all' jobStates: JobStateClient[] = [ 'all', 'active', 'completed', 'failed', 'waiting', 'delayed' ] jobStateItems: SelectOptionsItem[] = this.jobStates.map(s => ({ id: s, @@ -176,10 +176,10 @@ export class JobsComponent extends RestTable implements OnInit { private loadJobStateAndType () { const state = peertubeLocalStorage.getItem(JobsComponent.LS_STATE) - if (state) this.jobState = state as JobState + if (state && state !== 'undefined') this.jobState = state as JobState const jobType = peertubeLocalStorage.getItem(JobsComponent.LS_TYPE) - if (jobType) this.jobType = jobType as JobType + if (jobType && jobType !== 'undefined') this.jobType = jobType as JobType } private saveJobStateAndType () {