Handle plugin state prior to headless

This commit is contained in:
boatbomber 2022-09-30 14:14:28 -04:00
parent d7cee5c5be
commit e3a8152575

View file

@ -302,12 +302,6 @@ function App:startSession(host: string?, port: string?)
end)
serveSession:onStatusChanged(function(status, details)
self.headlessAPI:_updateProperty("Connected", status == ServeSession.Status.Connected)
if not self.headlessAPI.Connected then
self.headlessAPI:_updateProperty("Address", nil)
self.headlessAPI:_updateProperty("ProjectName", nil)
end
if status == ServeSession.Status.Connecting then
self:setPriorEndpoint(host, port)
@ -352,6 +346,12 @@ function App:startSession(host: string?, port: string?)
self:addNotification("Disconnected from session.")
end
end
self.headlessAPI:_updateProperty("Connected", status == ServeSession.Status.Connected)
if not self.headlessAPI.Connected then
self.headlessAPI:_updateProperty("Address", nil)
self.headlessAPI:_updateProperty("ProjectName", nil)
end
end)
serveSession:start()