mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-21 12:01:38 +00:00
Add Address and ProjectName when connected
This commit is contained in:
parent
4832035a18
commit
be89259bbd
2 changed files with 10 additions and 0 deletions
|
|
@ -268,6 +268,10 @@ function App:startSession(host: string?, port: string?)
|
|||
|
||||
serveSession:onStatusChanged(function(status, details)
|
||||
self.headlessAPI.Connected = status == ServeSession.Status.Connected
|
||||
if not self.headlessAPI.Connected then
|
||||
self.headlessAPI.Address = nil
|
||||
self.headlessAPI.ProjectName = nil
|
||||
end
|
||||
|
||||
if status == ServeSession.Status.Connecting then
|
||||
self:setPriorEndpoint(host, port)
|
||||
|
|
@ -279,6 +283,10 @@ function App:startSession(host: string?, port: string?)
|
|||
self:addNotification("Connecting to session...")
|
||||
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:setState({
|
||||
appStatus = AppStatus.Connected,
|
||||
projectName = details,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ function API.new(app, config, settings)
|
|||
local Rojo = {}
|
||||
|
||||
Rojo.Connected = if app.serveSession then app.serveSession:getStatus() == "Connected" else false
|
||||
Rojo.Address = nil
|
||||
Rojo.ProjectName = nil
|
||||
Rojo.Version = table.clone(config.version)
|
||||
Rojo.ProtocolVersion = config.protocolVersion
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue