Fix calendar events right drawer empty fields (#6271)
Fix calendar events right drawer empty fields
This commit is contained in:
@ -0,0 +1,23 @@
|
||||
import { CalendarEvent } from '@/activities/calendar/types/CalendarEvent';
|
||||
import { useUpsertRecordsInStore } from '@/object-record/record-store/hooks/useUpsertRecordsInStore';
|
||||
import { useEffect } from 'react';
|
||||
|
||||
type CalendarEventDetailsEffectProps = {
|
||||
record: CalendarEvent;
|
||||
};
|
||||
|
||||
export const CalendarEventDetailsEffect = ({
|
||||
record,
|
||||
}: CalendarEventDetailsEffectProps) => {
|
||||
const { upsertRecords } = useUpsertRecordsInStore();
|
||||
|
||||
useEffect(() => {
|
||||
if (!record) {
|
||||
return;
|
||||
}
|
||||
|
||||
upsertRecords([record]);
|
||||
}, [record, upsertRecords]);
|
||||
|
||||
return <></>;
|
||||
};
|
||||
Reference in New Issue
Block a user