Skip to content

Commit

Permalink
fix(expeditions): Expedition start time fix.
Browse files Browse the repository at this point in the history
Expedition start time was being overwritten per expedition instead of at the start as a whole, only setting it if it was null (when stop is pressed, its set to null)
  • Loading branch information
SobieskiCodes committed Jul 16, 2024
1 parent ecf0e98 commit b4d6a89
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/features/expeditions/expeditionSlice.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ const expeditionSlice = createSlice({
setActiveZone: (state, action) => {
console.log('Setting active zone:', action.payload.zoneName);
state.activeZone = action.payload.zoneName;
state.statistics.expeditionStartTime = Date.now();
if (state.statistics.expeditionStartTime === null) {
state.statistics.expeditionStartTime = Date.now();
}
state.statistics.currentExpeditionElapsedSeconds = 0;
},
clearActiveZone: (state) => {
Expand Down

0 comments on commit b4d6a89

Please sign in to comment.