Skip to content

Commit

Permalink
refactor: simplify shouldRemove variable
Browse files Browse the repository at this point in the history
  • Loading branch information
tyler-dane committed Dec 14, 2024
1 parent 13442a9 commit 6e20ac3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/web/src/views/Calendar/hooks/draft/useDraftUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,10 +385,8 @@ export const useDraftUtil = (
!dayjs(event.startDate).isBetween(startOfView, endOfView, null, "[]") &&
!dayjs(event.endDate).isBetween(startOfView, endOfView, null, "[]");

const _payload = { _id: event._id, event };
const payload = isOutsideView
? { ..._payload, shouldRemove: true }
: _payload;
const shouldRemove = isOutsideView ? true : false;
const payload = { _id: event._id, event, shouldRemove };
dispatch(editEventSlice.actions.request(payload));
} else {
dispatch(createEventSlice.actions.request(event));
Expand Down

0 comments on commit 6e20ac3

Please sign in to comment.