We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6bd191a commit cfcf620Copy full SHA for cfcf620
src/store/index.ts
@@ -239,7 +239,12 @@ export default createStore({
239
const index = state.todos.findIndex(
240
(todo: { newId: number }) => todo.newId === payload
241
);
242
- state.todos.splice(index, 1); //delete task item
+ const deleteTask: boolean = confirm(
243
+ `Do you want to delete the task ${state.todos[index].task}?\nThis action cannot be undone.`
244
+ );
245
+ if (deleteTask) {
246
+ state.todos.splice(index, 1); //delete task item
247
+ }
248
},
249
setUser: (state, user) => {
250
state.user = user; //set user data
0 commit comments