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),
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)