Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remember sync connection settings. #500

Merged
merged 1 commit into from
Nov 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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