Skip to content

Commit 2aee3a2

Browse files
committed
refactor(web): remove unused draft conversion functions from sidebar actions
1 parent c623eae commit 2aee3a2

File tree

1 file changed

+0
-38
lines changed

1 file changed

+0
-38
lines changed

packages/web/src/views/Calendar/components/Draft/sidebar/hooks/useSidebarActions.ts

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,6 @@ export const useSidebarActions = (
8989
const { setDraft, setIsDrafting, setIsSomedayFormOpen, setSomedayEvents } =
9090
setters;
9191

92-
const resetLocalDraftStateIfNeeded = () => {
93-
if (!state.isDrafting) return;
94-
95-
if (isSomedayEventFormOpen()) {
96-
setIsDrafting(false);
97-
setDraft(null);
98-
}
99-
};
100-
10192
const close = () => {
10293
setIsDrafting(false);
10394
setDraft(null);
@@ -119,35 +110,6 @@ export const useSidebarActions = (
119110
setIsSomedayFormOpen(true);
120111
}, [setIsSomedayFormOpen]);
121112

122-
// call this when enabling DND for drafts
123-
const convertSomedayDraftToTimed = (
124-
dropItem: DropResult_ReactDND,
125-
dates: { startDate: string; endDate: string },
126-
) => {
127-
const event = prepEvtAfterDraftDrop(
128-
Categories_Event.TIMED,
129-
dropItem,
130-
dates,
131-
);
132-
133-
dispatch(createEventSlice.actions.request(event));
134-
dispatch(draftSlice.actions.discard());
135-
};
136-
137-
const convertSomedayDraftToAllDay = (
138-
dropItem: DropResult_ReactDND,
139-
dates: { startDate: string; endDate: string },
140-
) => {
141-
const event = prepEvtAfterDraftDrop(
142-
Categories_Event.ALLDAY,
143-
dropItem,
144-
dates,
145-
);
146-
147-
dispatch(createEventSlice.actions.request(event));
148-
dispatch(draftSlice.actions.discard());
149-
};
150-
151113
const convertSomedayToCalendarEvent = useCallback(
152114
(
153115
_id: string,

0 commit comments

Comments
 (0)