Skip to content

Commit d77d387

Browse files
committed
Add alert that show how many XP earned when task is completed
1 parent f10299c commit d77d387

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/components/NewTodo.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export default defineComponent({
102102
},
103103
mounted() {
104104
const dueDateInput = document.getElementById("dueDate") as HTMLInputElement;
105-
dueDateInput.min = currentLocalDate.toISOString().split("T")[0]; //minimum due date must be today
105+
dueDateInput.min = currentLocalDate.toISOString().split("T")[0]; //task minimum due date must be today
106106
},
107107
methods: {
108108
/**

src/store/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ export default createStore({
184184
1
185185
); //get at least 1 XP when the task is completed
186186
state.user.xp += xp; //get amount of XP earned based on task difficulty, task priority, task due date, task repetition, task streak and daily streak multipliers
187+
alert(`Task ${task.task} completed!\nYou earned ${xp} XP!`); //alert user to show how many XP they earned after completing the task
187188
state.user.level = Math.max(
188189
1,
189190
Math.floor(Math.pow(state.user.xp, 1 / 3 + 5e-16))

0 commit comments

Comments
 (0)