Skip to content

Commit 599beb8

Browse files
committed
Fix rating calculation
1 parent 99c1186 commit 599beb8

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/store/index.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -614,12 +614,10 @@ export default createStore({
614614
); //get at least 1 XP when the task is completed
615615
state.user.xp += xpEarned; //get the amount of XP earned based on task difficulty, task priority, task due date, task repetition, task streak, daily streak and task rank multipliers
616616
state.user.rating += Math.max(
617-
(10 + Math.log(Math.max(state.user.rating + 100, 100)) ** 2) *
617+
((10 + Math.log(Math.max(state.user.rating + 100, 100)) ** 2) *
618618
repeatMultiplier *
619-
dateMultiplier <
620-
1
621-
? 1 - dateMultiplier
622-
: (dateMultiplier - 1) / Math.max(state.user.tasksCompletedToday, 1),
619+
(dateMultiplier < 1 ? 1 - dateMultiplier : dateMultiplier - 1)) /
620+
Math.max(state.user.tasksCompletedToday, 1),
623621
0,
624622
); //get the amount of rating poings earned based on user rating, task repeat multiplier and number of tasks completed today
625623
state.user.rating = Math.max(state.user.rating, 0); //make sure user rating is not below 0

0 commit comments

Comments
 (0)