Skip to content

Commit c1ecd7f

Browse files
committed
Fix code
1 parent 8f955b3 commit c1ecd7f

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/store/index.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -238,13 +238,11 @@ export default createStore({
238238
if (daysSinceLastCompletion >= 1) {
239239
//repeat for each day of inactivity
240240
for (let i = 0; i < daysSinceLastCompletion; i++) {
241-
state.user.rating = Math.max(
242-
state.user.rating -
243-
Math.sqrt(Math.max(state.user.rating, 0)) *
244-
(1 + Math.log(Math.max(i + 1, 1))) *
245-
(1 + Math.log(Math.max(overdueTasks + 1, 1))),
246-
0,
247-
); //decrease user rating for each day of inactivity
241+
state.user.rating -=
242+
Math.sqrt(Math.max(state.user.rating, 0)) *
243+
(1 + Math.log(Math.max(i + 1, 1))) *
244+
(1 + Math.log(Math.max(overdueTasks + 1, 1))); //decrease user rating for each day of inactivity
245+
state.user.rating = Math.max(state.user.rating, 0); //make sure rating is not below 0
248246
}
249247
}
250248
//calculate task streak XP multiplier

0 commit comments

Comments
 (0)