Skip to content

Commit

Permalink
Added totalWorkRounds to Timer store
Browse files Browse the repository at this point in the history
  • Loading branch information
mihaiconstantin committed May 16, 2020
1 parent c508944 commit 48945ef
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/renderer/store/modules/Timer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { defaults } from './../../utils/LocalStore'
const state = {
round: 1,
workRounds: parseInt(localStore.get('workRounds')),
totalWorkRounds: 0,
timeLongBreak: parseInt(localStore.get('timeLongBreak')),
timeShortBreak: parseInt(localStore.get('timeShortBreak')),
timeWork: parseInt(localStore.get('timeWork')),
Expand All @@ -18,6 +19,9 @@ const getters = {
workRounds() {
return state.workRounds
},
totalWorkRounds() {
return state.totalWorkRounds
},
timeLongBreak() {
return state.timeLongBreak
},
Expand All @@ -44,6 +48,10 @@ const mutations = {
state.round = 1
},

INCREMENT_TOTAL_WORK_ROUNDS(state) {
state.totalWorkRounds += 1
},

RESET_DEFAULTS(state) {
state.workRounds = defaults.workRounds
state.timeLongBreak = defaults.timeLongBreak
Expand Down Expand Up @@ -85,6 +93,10 @@ const actions = {
commit('RESET_ROUND')
},

incrementTotalWorkRounds({ commit }) {
commit('INCREMENT_TOTAL_WORK_ROUNDS')
},

resetDefaults({ commit }) {
commit('RESET_DEFAULTS')
localStore.set('workRounds', defaults.workRounds)
Expand Down

0 comments on commit 48945ef

Please sign in to comment.