feat: skip the confirmation modal when deleting empty schedules (#716)
Co-authored-by: Derek Chen <derex1987@gmail.com>
This commit is contained in:
@@ -121,6 +121,10 @@ export default function ScheduleListItem({ schedule, onClick }: ScheduleListItem
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleDelete = () => {
|
const handleDelete = () => {
|
||||||
|
if (schedule.courses.length <= 0) {
|
||||||
|
deleteSchedule(schedule.id);
|
||||||
|
return;
|
||||||
|
}
|
||||||
showDialog({
|
showDialog({
|
||||||
title: 'Delete schedule?',
|
title: 'Delete schedule?',
|
||||||
description: (
|
description: (
|
||||||
|
|||||||
Reference in New Issue
Block a user