Skip to content

Commit d0cf8d8

Browse files
committed
Change a task to the task for comments to improve grammar
1 parent 67347d6 commit d0cf8d8

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/store/index.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ export default createStore({
1010
xp: 0 as number,
1111
progress: 0 as number,
1212
score: 0 as number, //set score to 0 when state is created
13-
bestScoreEarned: 0 as number, //the highest number of points earned achieved when a task is completed
13+
bestScoreEarned: 0 as number, //the highest number of points earned achieved when the task is completed
1414
dailyStreak: 0 as number, //set daily streak to 0 and last completion date to undefined when state is created
1515
tasksCompletedToday: 0 as number, //set the number of tasks completed in a day (today) to 0
1616
totalTasksCompleted: 0 as number, //set the total number of tasks completed to 0
1717
lastCompletionDate: undefined as string | undefined, //last completion date in YYYY-MM-DD string
1818
},
1919
},
2020
getters: {
21-
getTodos: (state) => state.todos, //get a task list
21+
getTodos: (state) => state.todos, //get the task list
2222
getXp: (state) => state.user.xp, //get user XP
2323
getLevel: (state) => state.user.level, //get user level
2424
getProgress: (state) => state.user.progress, //get user level progress
@@ -27,7 +27,7 @@ export default createStore({
2727
getTasksCompletedToday: (state) => state.user.tasksCompletedToday, //get user tasks completed in a day
2828
getTotalTasksCompleted: (state) => state.user.totalTasksCompleted, //get user total tasks completed
2929
getLastCompletionDate: (state) => state.user.lastCompletionDate, //get user last completion date
30-
getBestScoreEarned: (state) => state.user.bestScoreEarned, //get the user best score earned when a task is completed
30+
getBestScoreEarned: (state) => state.user.bestScoreEarned, //get the user best score earned when the task is completed
3131
},
3232
mutations: {
3333
/**
@@ -50,8 +50,8 @@ export default createStore({
5050
(Number(new Date().setHours(23, 59, 59, 999)) -
5151
Number(new Date())) /
5252
(1000 * 24 * 60 * 60))
53-
: 1 + 1 / (daysToDue + 1); //if a task is overdue, XP and score multiplier is less than 1 that decreases over time when a task is overdue, else XP multiplier bonus increases (more than 1) when a task gets closer to due date
54-
let streakMultiplier: number; //calculate task streak XP and score multiplier based on task streak, if a 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
53+
: 1 + 1 / (daysToDue + 1); //if the task is overdue, XP and score multiplier is less than 1 that decreases over time when the task is overdue, else XP multiplier bonus increases (more than 1) when the task gets closer to due date
54+
let streakMultiplier: number; //calculate task streak XP and score multiplier based on task streak, if the 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
5555
let repeatMultiplier: number; //calculate task repetition XP and score multiplier based on task repetition occurrence and task repetition frequency
5656
let dailyStreakMultiplier: number; //calculate daily streak XP and score multiplier based on daily streak
5757
let levelMultiplier: number; //calculate level score multiplier based on user level
@@ -107,7 +107,7 @@ export default createStore({
107107
//if task is overdue
108108
task.streak = 0; //reset task streak to 0
109109
} else {
110-
//if a task is completed before due date (not overdue)
110+
//if the task is completed before due date (not overdue)
111111
task.streak++; //increase task streak
112112
}
113113
//calculate daily streak
@@ -369,7 +369,7 @@ export default createStore({
369369
} else {
370370
activeTasksMultiplier = 27; //27x active task score multiplier from 10,000 active tasks
371371
}
372-
//calculate the amount of XP earned and points earned when a task is completed
372+
//calculate the amount of XP earned and points earned when the task is completed
373373
const xpEarned: number = Math.max(
374374
Math.floor(
375375
task.difficulty *
@@ -401,7 +401,7 @@ export default createStore({
401401
state.user.score += pointsEarned; //get amount of points earned based on task difficulty, task priority, task due date, task repetition, task streak, daily streak and user level multipliers
402402
if (pointsEarned > state.user.bestScoreEarned) {
403403
//if points earned are greater than the best score earned
404-
state.user.bestScoreEarned = pointsEarned; //set the best score earned to points earned when a task is completed
404+
state.user.bestScoreEarned = pointsEarned; //set the best score earned to points earned when the task is completed
405405
}
406406
alert(
407407
`Task ${task.task} completed!\nYou earned ${xpEarned.toLocaleString(
@@ -458,7 +458,7 @@ export default createStore({
458458
(todo: { newId: number }) => todo.newId === payload
459459
);
460460
if (Number(item.repeatFrequency) === 5) {
461-
//if a task is a one-time only
461+
//if the task is a one-time only
462462
item.completed = !item.completed; //complete task item (set completed task to true)
463463
} else {
464464
item.timesCompleted++; //increment number of times tasks has been completed by 1

0 commit comments

Comments
 (0)