From cec74abc005218a176660a94f9330470f2d66fd9 Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Wed, 22 Apr 2020 15:26:51 +0530 Subject: [PATCH] core: handle initialisation for empty async jobs list Signed-off-by: Rohit Yadav --- ui/src/components/header/HeaderNotice.vue | 2 +- ui/src/core/bootstrap.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/src/components/header/HeaderNotice.vue b/ui/src/components/header/HeaderNotice.vue index e807e9cb847..1cbbb6b7ebc 100644 --- a/ui/src/components/header/HeaderNotice.vue +++ b/ui/src/components/header/HeaderNotice.vue @@ -122,7 +122,7 @@ export default { this.startPolling() }, mounted () { - this.jobs = store.getters.asyncJobIds.reverse() + this.jobs = (store.getters.asyncJobIds || []).reverse() this.$store.watch( (state, getters) => getters.asyncJobIds, (newValue, oldValue) => { diff --git a/ui/src/core/bootstrap.js b/ui/src/core/bootstrap.js index da7d184d541..ceefe3fa6c8 100644 --- a/ui/src/core/bootstrap.js +++ b/ui/src/core/bootstrap.js @@ -47,5 +47,5 @@ export default function Initializer () { store.commit('TOGGLE_MULTI_TAB', Vue.ls.get(DEFAULT_MULTI_TAB, config.multiTab)) store.commit('SET_TOKEN', Vue.ls.get(ACCESS_TOKEN)) store.commit('SET_PROJECT', Vue.ls.get(CURRENT_PROJECT)) - store.commit('SET_ASYNC_JOB_IDS', Vue.ls.get(ASYNC_JOB_IDS)) + store.commit('SET_ASYNC_JOB_IDS', Vue.ls.get(ASYNC_JOB_IDS) || []) }