@@ -220,6 +220,9 @@ export function EventEditorDrawer({
220220 const [ error , setError ] = useState < string | null > ( null ) ;
221221
222222 const isCreate = mode === "create" ;
223+ const calendarRequestSide = isCreate
224+ ? ( createDefaults ?. side ?? "owner" )
225+ : ( event ?. side ?? "owner" ) ;
223226
224227 // Seed form when the event changes (edit) or drawer opens in create mode.
225228 useEffect ( ( ) => {
@@ -241,7 +244,7 @@ export function EventEditorDrawer({
241244 setCalendarsLoading ( true ) ;
242245 setCalendarsError ( null ) ;
243246 void client
244- . getLifeOpsCalendars ( { side : "owner" } )
247+ . getLifeOpsCalendars ( { side : calendarRequestSide } )
245248 . then ( ( response ) => {
246249 if ( cancelled ) return ;
247250 setCalendars ( response . calendars ) ;
@@ -286,7 +289,7 @@ export function EventEditorDrawer({
286289 return ( ) => {
287290 cancelled = true ;
288291 } ;
289- } , [ open ] ) ;
292+ } , [ open , calendarRequestSide ] ) ;
290293
291294 const calendarOptions = useMemo ( ( ) => {
292295 if ( calendars . length > 0 ) return calendars ;
@@ -316,12 +319,12 @@ export function EventEditorDrawer({
316319 ] satisfies LifeOpsCalendarSummary [ ] ;
317320 } , [ calendars , form . calendarId , form . grantId , form . side ] ) ;
318321
319- const updateForm = useCallback ( < K extends keyof FormState > (
320- key : K ,
321- value : FormState [ K ] ,
322- ) => {
323- setForm ( ( prev ) => ( { ... prev , [ key ] : value } ) ) ;
324- } , [ ] ) ;
322+ const updateForm = useCallback (
323+ < K extends keyof FormState > ( key : K , value : FormState [ K ] ) => {
324+ setForm ( ( prev ) => ( { ... prev , [ key ] : value } ) ) ;
325+ } ,
326+ [ ] ,
327+ ) ;
325328
326329 const handleSave = useCallback (
327330 async ( options : { keepOpen ?: boolean } = { } ) => {
0 commit comments