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.
This commit is contained in:
Joe 2026-01-27 10:06:57 -06:00
parent bda2af3dfb
commit 3038183508

View file

@ -695,16 +695,14 @@ function App:startSession()
text = tostring(details), text = tostring(details),
timeout = 10, timeout = 10,
}) })
else else
self:setState({ self:setState({
appStatus = AppStatus.NotConnected, appStatus = AppStatus.NotConnected,
toolbarIcon = Assets.Images.PluginButton, toolbarIcon = Assets.Images.PluginButton,
}) })
self:addNotification({ -- Intentionally not showing a notification here to avoid
text = "Disconnected from session.", -- Studio switching focus to the viewport on disconnect
timeout = 10, end
})
end
end end
end) end)