Skip to content

Commit 2851ce1

Browse files
committed
Fix XP multiplier calculation when task is overdue
1 parent cd081d3 commit 2851ce1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/store/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default createStore({
3434
Number(new Date().setHours(23, 59, 59, 999))) /
3535
(1000 * 60 * 60 * 24); //calculate number of days until the task is due
3636
const dateMultiplier: number =
37-
daysToDue < 0 ? -3 / (daysToDue - 1) : 1 + 1 / (daysToDue + 1); //if task is overdue, XP multiplier is less than 1 that decreases over time when task is overdue, else XP multiplier bonus increases (more than 1) when task gets closer to due date
37+
daysToDue < 0 ? -2 / (daysToDue - 1) : 1 + 1 / (daysToDue + 1); //if task is overdue, XP multiplier is less than 1 that decreases over time when task is overdue, else XP multiplier bonus increases (more than 1) when task gets closer to due date
3838
let streakMultiplier: number; //calculate task streak XP multiplier based on task streak, if task is completed before the due date then the streak increases else if the task is completed overdue (after the due date) reset task streak to 0
3939
let repeatMultiplier: number; //calculate task repetition XP multiplier based on task repetition occurrence and task repetition frequency
4040
let dailyStreakMultiplier: number; //calculate daily streak XP multiplier based on daily streak

0 commit comments

Comments
 (0)