Skip to content

Commit

Permalink
improve view of old error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
billyc committed Mar 29, 2022
1 parent dd70112 commit 31a698e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,13 @@ export default new Vuex.Store({
if (!value.jump) state.viewState = value
else if (state.viewState.initial) state.viewState = value
},
error(state, value: Warnings) {
// don't repeat yourself
error(state, value: string) {
if (
!state.statusErrors.length ||
state.statusErrors[state.statusErrors.length - 1] !== value
state.statusErrors[state.statusErrors.length - 1].msg !== value
) {
state.statusErrors.push(value)
state.statusErrors.push({ msg: value, desc: '' })
state.isShowingLeftBar = true
}
},
setStatus(state, value: { type: Status; msg: string; desc?: string }) {
Expand Down Expand Up @@ -152,6 +152,7 @@ export default new Vuex.Store({
state.statusErrors[state.statusErrors.length - 1].msg !== value.msg
) {
state.statusErrors.push(warningObj)
state.isShowingLeftBar = true
}
}
},
Expand Down

0 comments on commit 31a698e

Please sign in to comment.