mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-25 15:16:07 +00:00
Remember sync connection settings. (#500)
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user