core: handle initialisation for empty async jobs list

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rohit Yadav 2020-04-22 15:26:51 +05:30
parent 3bc553695e
commit cec74abc00
2 changed files with 2 additions and 2 deletions

View File

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

View File

@ -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) || [])
}