mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-05 23:43:57 +00:00
fix: close editor on event delete
This commit is contained in:
@@ -8,12 +8,14 @@ import { SupportedEvent } from 'ontime-types';
|
||||
|
||||
import { useEventAction } from '../../common/hooks/useEventAction';
|
||||
import { useCursor } from '../../common/stores/cursorStore';
|
||||
import { useEventEditorStore } from '../../common/stores/eventEditor';
|
||||
|
||||
import style from './RundownMenu.module.scss';
|
||||
|
||||
const RundownMenu = () => {
|
||||
const isCursorLocked = useCursor((state) => state.isCursorLocked);
|
||||
const toggleCursorLocked = useCursor((state) => state.toggleCursorLocked);
|
||||
const removeOpenEvent = useEventEditorStore((state) => state.removeOpenEvent);
|
||||
|
||||
const { addEvent, deleteAllEvents } = useEventAction();
|
||||
|
||||
@@ -31,7 +33,8 @@ const RundownMenu = () => {
|
||||
|
||||
const deleteAll = useCallback(() => {
|
||||
deleteAllEvents();
|
||||
}, [deleteAllEvents]);
|
||||
removeOpenEvent();
|
||||
}, [deleteAllEvents, removeOpenEvent]);
|
||||
|
||||
return (
|
||||
<HStack className={style.headerButtons}>
|
||||
|
||||
Reference in New Issue
Block a user