Skip to content

Commit 4d86b01

Browse files
committed
Fix a bug that caused the 'started at' time to jump forward on page refresh
1 parent 2c9d424 commit 4d86b01

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: src/views/BrewView.vue

+4-1
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,11 @@ export default defineComponent({
7878
*/
7979
infusionCount(newCount) {
8080
if (newCount === 2) {
81+
// If started somewhat recently, the initial time should be the same as the first infusion
8182
const initialTimeMillis = this.initialTime * 1000
82-
this.startedAt = Date.now() - initialTimeMillis
83+
if (Date.now() - this.startedAt < initialTimeMillis * 2) {
84+
this.startedAt = Date.now() - initialTimeMillis
85+
}
8386
}
8487
},
8588
},

0 commit comments

Comments
 (0)