mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-18 13:44:12 +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 { useEventAction } from '../../common/hooks/useEventAction';
|
||||||
import { useCursor } from '../../common/stores/cursorStore';
|
import { useCursor } from '../../common/stores/cursorStore';
|
||||||
|
import { useEventEditorStore } from '../../common/stores/eventEditor';
|
||||||
|
|
||||||
import style from './RundownMenu.module.scss';
|
import style from './RundownMenu.module.scss';
|
||||||
|
|
||||||
const RundownMenu = () => {
|
const RundownMenu = () => {
|
||||||
const isCursorLocked = useCursor((state) => state.isCursorLocked);
|
const isCursorLocked = useCursor((state) => state.isCursorLocked);
|
||||||
const toggleCursorLocked = useCursor((state) => state.toggleCursorLocked);
|
const toggleCursorLocked = useCursor((state) => state.toggleCursorLocked);
|
||||||
|
const removeOpenEvent = useEventEditorStore((state) => state.removeOpenEvent);
|
||||||
|
|
||||||
const { addEvent, deleteAllEvents } = useEventAction();
|
const { addEvent, deleteAllEvents } = useEventAction();
|
||||||
|
|
||||||
@@ -31,7 +33,8 @@ const RundownMenu = () => {
|
|||||||
|
|
||||||
const deleteAll = useCallback(() => {
|
const deleteAll = useCallback(() => {
|
||||||
deleteAllEvents();
|
deleteAllEvents();
|
||||||
}, [deleteAllEvents]);
|
removeOpenEvent();
|
||||||
|
}, [deleteAllEvents, removeOpenEvent]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HStack className={style.headerButtons}>
|
<HStack className={style.headerButtons}>
|
||||||
|
|||||||
Reference in New Issue
Block a user