@@ -751,36 +751,38 @@ function App:startSession()
751751 end
752752
753753 local confirmationBehavior = Settings :get (" confirmationBehavior" )
754- if confirmationBehavior == " Initial" then
755- -- Only confirm if we haven't synced this project yet this session
756- if self .knownProjects [serverInfo .projectName ] then
757- Log .trace (
758- " Accepting patch without confirmation because project has already been connected and behavior is set to Initial"
759- )
760- return " Accept"
761- end
762- elseif confirmationBehavior == " Large Changes" then
763- -- Only confirm if the patch impacts many instances
764- if PatchSet .countInstances (patch ) < Settings :get (" largeChangesConfirmationThreshold" ) then
765- Log .trace (
766- " Accepting patch without confirmation because patch is small and behavior is set to Large Changes"
767- )
768- return " Accept"
769- end
770- elseif confirmationBehavior == " Unlisted PlaceId" then
771- -- Only confirm if the current placeId is not in the servePlaceIds allowlist
772- if serverInfo .expectedPlaceIds then
773- local isListed = table .find (serverInfo .expectedPlaceIds , game .PlaceId ) ~= nil
774- if isListed then
754+ if confirmationBehavior ~= " Always" then
755+ if confirmationBehavior == " Initial" then
756+ -- Only confirm if we haven't synced this project yet this session
757+ if self .knownProjects [serverInfo .projectName ] then
775758 Log .trace (
776- " Accepting patch without confirmation because placeId is listed and behavior is set to Unlisted PlaceId "
759+ " Accepting patch without confirmation because project has already been connected and behavior is set to Initial "
777760 )
778761 return " Accept"
779762 end
763+ elseif confirmationBehavior == " Large Changes" then
764+ -- Only confirm if the patch impacts many instances
765+ if PatchSet .countInstances (patch ) < Settings :get (" largeChangesConfirmationThreshold" ) then
766+ Log .trace (
767+ " Accepting patch without confirmation because patch is small and behavior is set to Large Changes"
768+ )
769+ return " Accept"
770+ end
771+ elseif confirmationBehavior == " Unlisted PlaceId" then
772+ -- Only confirm if the current placeId is not in the servePlaceIds allowlist
773+ if serverInfo .expectedPlaceIds then
774+ local isListed = table .find (serverInfo .expectedPlaceIds , game .PlaceId ) ~= nil
775+ if isListed then
776+ Log .trace (
777+ " Accepting patch without confirmation because placeId is listed and behavior is set to Unlisted PlaceId"
778+ )
779+ return " Accept"
780+ end
781+ end
782+ elseif confirmationBehavior == " Never" then
783+ Log .trace (" Accepting patch without confirmation because behavior is set to Never" )
784+ return " Accept"
780785 end
781- elseif confirmationBehavior == " Never" then
782- Log .trace (" Accepting patch without confirmation because behavior is set to Never" )
783- return " Accept"
784786 end
785787
786788 -- The datamodel name gets overwritten by Studio, making confirmation of it intrusive
@@ -821,7 +823,22 @@ function App:startSession()
821823 timeout = 7 ,
822824 })
823825
824- return self .confirmationEvent :Wait ()
826+ local result = self .confirmationEvent :Wait ()
827+
828+ -- Reset UI state back to Connected after confirmation
829+ -- This is needed for ongoing WebSocket patches where the session
830+ -- is already connected and won't trigger a status change
831+ if self .serveSession and self .serveSession :getStatus () == ServeSession .Status .Connected then
832+ self :setState ({
833+ appStatus = AppStatus .Connected ,
834+ toolbarIcon = Assets .Images .PluginButtonConnected ,
835+ -- Clear patchTree to avoid animation issues when the
836+ -- PatchVisualizer unmounts while Flipper motors are running
837+ patchTree = nil ,
838+ })
839+ end
840+
841+ return result
825842 end )
826843
827844 serveSession :start ()
0 commit comments