@@ -214,6 +214,9 @@ export function ContentTabSync( { selectedSite }: { selectedSite: SiteDetails }
214214 }
215215 } ;
216216
217+ // Using a local variable to avoid non-null assertion operator in pushSite and pullSite
218+ const selectedRemoteSite = modalState . selectedRemoteSite ;
219+
217220 return (
218221 < div className = "flex flex-col h-full overflow-y-auto" >
219222 { connectedSites . length > 0 ? (
@@ -273,22 +276,22 @@ export function ContentTabSync( { selectedSite }: { selectedSite: SiteDetails }
273276 />
274277 ) }
275278
276- { modalState . mode && modalState . mode !== 'connect' && modalState . selectedRemoteSite && (
279+ { modalState . mode && modalState . mode !== 'connect' && selectedRemoteSite && (
277280 < SyncDialog
278281 type = { modalState . mode }
279282 localSite = { selectedSite }
280- remoteSite = { modalState . selectedRemoteSite }
283+ remoteSite = { selectedRemoteSite }
281284 onPush = { ( tree ) => {
282285 const pushOptions = convertTreeToPushOptions ( tree ) ;
283- void pushSite ( modalState . selectedRemoteSite ! , selectedSite , pushOptions ) ;
286+ void pushSite ( selectedRemoteSite , selectedSite , pushOptions ) ;
284287 setModalState ( {
285288 mode : null ,
286289 selectedRemoteSite : null ,
287290 } ) ;
288291 } }
289292 onPull = { ( tree ) => {
290293 const pullOptions = convertTreeToPullOptions ( tree ) ;
291- void pullSite ( modalState . selectedRemoteSite ! , selectedSite , pullOptions ) ;
294+ void pullSite ( selectedRemoteSite , selectedSite , pullOptions ) ;
292295 setModalState ( {
293296 mode : null ,
294297 selectedRemoteSite : null ,
0 commit comments