Skip to content

Commit

Permalink
fix: disable failed init components
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Dej <[email protected]>
  • Loading branch information
meteyou committed Dec 10, 2023
1 parent 151f865 commit 4606c3e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/store/server/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ export const actions: ActionTree<ServerState, RootState> = {
},

addFailedInitComponent({ commit }, payload) {
commit('removeComponent', payload)
commit('addFailedInitComponent', payload)
},
}
10 changes: 10 additions & 0 deletions src/store/server/mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,14 @@ export const mutations: MutationTree<ServerState> = {

Vue.set(state, 'failed_init_components', failed_init_components)
},

removeComponent(state, payload) {
const components = state.components
const index = components.indexOf(payload)

if (index === -1) return

components.splice(index, 1)
Vue.set(state, 'components', components)
},
}

0 comments on commit 4606c3e

Please sign in to comment.