mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-20 17:41:37 +00:00
Remember sync connection settings. (#500)
This commit is contained in:
parent
da25c80d0b
commit
9904d94e4c
1 changed files with 7 additions and 2 deletions
|
|
@ -14,6 +14,8 @@ local PORT_WIDTH = 74
|
||||||
local DIVIDER_WIDTH = 1
|
local DIVIDER_WIDTH = 1
|
||||||
local HOST_OFFSET = 12
|
local HOST_OFFSET = 12
|
||||||
|
|
||||||
|
local lastHost, lastPort
|
||||||
|
|
||||||
local e = Roact.createElement
|
local e = Roact.createElement
|
||||||
|
|
||||||
local function AddressEntry(props)
|
local function AddressEntry(props)
|
||||||
|
|
@ -24,7 +26,7 @@ local function AddressEntry(props)
|
||||||
layoutOrder = props.layoutOrder,
|
layoutOrder = props.layoutOrder,
|
||||||
}, {
|
}, {
|
||||||
Host = e("TextBox", {
|
Host = e("TextBox", {
|
||||||
Text = "",
|
Text = lastHost or "",
|
||||||
Font = Enum.Font.Code,
|
Font = Enum.Font.Code,
|
||||||
TextSize = 18,
|
TextSize = 18,
|
||||||
TextColor3 = theme.AddressEntry.TextColor,
|
TextColor3 = theme.AddressEntry.TextColor,
|
||||||
|
|
@ -43,7 +45,7 @@ local function AddressEntry(props)
|
||||||
}),
|
}),
|
||||||
|
|
||||||
Port = e("TextBox", {
|
Port = e("TextBox", {
|
||||||
Text = "",
|
Text = lastPort or "",
|
||||||
Font = Enum.Font.Code,
|
Font = Enum.Font.Code,
|
||||||
TextSize = 18,
|
TextSize = 18,
|
||||||
TextColor3 = theme.AddressEntry.TextColor,
|
TextColor3 = theme.AddressEntry.TextColor,
|
||||||
|
|
@ -121,6 +123,9 @@ function NotConnectedPage:render()
|
||||||
local hostText = self.hostRef.current.Text
|
local hostText = self.hostRef.current.Text
|
||||||
local portText = self.portRef.current.Text
|
local portText = self.portRef.current.Text
|
||||||
|
|
||||||
|
lastHost = hostText
|
||||||
|
lastPort = portText
|
||||||
|
|
||||||
self.props.onConnect(
|
self.props.onConnect(
|
||||||
#hostText > 0 and hostText or Config.defaultHost,
|
#hostText > 0 and hostText or Config.defaultHost,
|
||||||
#portText > 0 and portText or Config.defaultPort
|
#portText > 0 and portText or Config.defaultPort
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue