mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-10-23 06:46:11 +08:00
Add completed state
This commit is contained in:
@@ -36,6 +36,9 @@ import {
|
||||
BATCH_DELETE_PENDING_TASKS_SUCCESS,
|
||||
ARCHIVE_ALL_PENDING_TASKS_SUCCESS,
|
||||
DELETE_ALL_PENDING_TASKS_SUCCESS,
|
||||
DELETE_COMPLETED_TASK_SUCCESS,
|
||||
DELETE_ALL_COMPLETED_TASKS_SUCCESS,
|
||||
BATCH_DELETE_COMPLETED_TASKS_SUCCESS,
|
||||
} from "../actions/tasksActions";
|
||||
|
||||
interface SnackbarState {
|
||||
@@ -285,6 +288,25 @@ function snackbarReducer(
|
||||
message: "All archived tasks deleted",
|
||||
};
|
||||
|
||||
case DELETE_COMPLETED_TASK_SUCCESS:
|
||||
return {
|
||||
isOpen: true,
|
||||
message: `Completed task deleted`,
|
||||
};
|
||||
|
||||
case DELETE_ALL_COMPLETED_TASKS_SUCCESS:
|
||||
return {
|
||||
isOpen: true,
|
||||
message: "All completed tasks deleted",
|
||||
};
|
||||
|
||||
case BATCH_DELETE_COMPLETED_TASKS_SUCCESS:
|
||||
const n = action.payload.deleted_ids.length;
|
||||
return {
|
||||
isOpen: true,
|
||||
message: `${n} completed ${n === 1 ? "task" : "tasks"} deleted`,
|
||||
};
|
||||
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
Reference in New Issue
Block a user