Skip to content

Commit

Permalink
Remember sync connection settings. (#500)
Browse files Browse the repository at this point in the history
  • Loading branch information
GlowingUmbreon authored Nov 20, 2021
1 parent da25c80 commit 9904d94
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions plugin/src/App/StatusPages/NotConnected.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ local PORT_WIDTH = 74
local DIVIDER_WIDTH = 1
local HOST_OFFSET = 12

local lastHost, lastPort

local e = Roact.createElement

local function AddressEntry(props)
Expand All @@ -24,7 +26,7 @@ local function AddressEntry(props)
layoutOrder = props.layoutOrder,
}, {
Host = e("TextBox", {
Text = "",
Text = lastHost or "",
Font = Enum.Font.Code,
TextSize = 18,
TextColor3 = theme.AddressEntry.TextColor,
Expand All @@ -43,7 +45,7 @@ local function AddressEntry(props)
}),

Port = e("TextBox", {
Text = "",
Text = lastPort or "",
Font = Enum.Font.Code,
TextSize = 18,
TextColor3 = theme.AddressEntry.TextColor,
Expand Down Expand Up @@ -121,6 +123,9 @@ function NotConnectedPage:render()
local hostText = self.hostRef.current.Text
local portText = self.portRef.current.Text

lastHost = hostText
lastPort = portText

self.props.onConnect(
#hostText > 0 and hostText or Config.defaultHost,
#portText > 0 and portText or Config.defaultPort
Expand Down

0 comments on commit 9904d94

Please sign in to comment.