From 303818350824cab3b0a2a8d6a46c31126c2c178a Mon Sep 17 00:00:00 2001 From: Joe Date: Tue, 27 Jan 2026 10:06:57 -0600 Subject: [PATCH] Refactor disconnect handling in App:startSession to avoid notifications on disconnect - Updated the logic to prevent showing a notification when the app disconnects, ensuring that Studio does not switch focus to the viewport during this event. --- plugin/src/App/init.lua | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/plugin/src/App/init.lua b/plugin/src/App/init.lua index 48cf72ef..d10bde6a 100644 --- a/plugin/src/App/init.lua +++ b/plugin/src/App/init.lua @@ -695,16 +695,14 @@ function App:startSession() text = tostring(details), timeout = 10, }) - else - self:setState({ - appStatus = AppStatus.NotConnected, - toolbarIcon = Assets.Images.PluginButton, - }) - self:addNotification({ - text = "Disconnected from session.", - timeout = 10, - }) - end + else + self:setState({ + appStatus = AppStatus.NotConnected, + toolbarIcon = Assets.Images.PluginButton, + }) + -- Intentionally not showing a notification here to avoid + -- Studio switching focus to the viewport on disconnect + end end end)