Prevent loading undefined job state

pull/6784/head
Chocobozzz 2024-12-10 11:15:48 +01:00
parent 6ec059165a
commit d480c6a437
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 3 additions and 3 deletions

View File

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