mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-21 20:21:38 +00:00
Add Changed event
This commit is contained in:
parent
2a25193941
commit
17b2752b38
2 changed files with 17 additions and 9 deletions
|
|
@ -267,10 +267,10 @@ function App:startSession(host: string?, port: string?)
|
|||
end)
|
||||
|
||||
serveSession:onStatusChanged(function(status, details)
|
||||
self.headlessAPI.Connected = status == ServeSession.Status.Connected
|
||||
self.headlessAPI:_updateProperty("Connected", status == ServeSession.Status.Connected)
|
||||
if not self.headlessAPI.Connected then
|
||||
self.headlessAPI.Address = nil
|
||||
self.headlessAPI.ProjectName = nil
|
||||
self.headlessAPI:_updateProperty("Address", nil)
|
||||
self.headlessAPI:_updateProperty("ProjectName", nil)
|
||||
end
|
||||
|
||||
if status == ServeSession.Status.Connecting then
|
||||
|
|
@ -284,8 +284,8 @@ function App:startSession(host: string?, port: string?)
|
|||
elseif status == ServeSession.Status.Connected then
|
||||
local address = string.format("%s:%s", host :: string, port :: string)
|
||||
|
||||
self.headlessAPI.Address = address
|
||||
self.headlessAPI.ProjectName = details
|
||||
self.headlessAPI:_updateProperty("Address", address)
|
||||
self.headlessAPI:_updateProperty("ProjectName", details)
|
||||
|
||||
self:setState({
|
||||
appStatus = AppStatus.Connected,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue