Skip to content

Commit

Permalink
Merge pull request #24 from vingard/dev
Browse files Browse the repository at this point in the history
1.2.0 final tweaks
  • Loading branch information
vingard authored May 24, 2024
2 parents 88a9fda + 7313224 commit 1b4b7ca
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,7 @@ async function handleGetServerList() {
}

async function handleCreateServer(event: any, serverInfo: any) {
if (processWatcher.isServerOpen()) return dialog.showErrorBox("Server already running", "You already have a server running!")
let args = ""

if (serverInfo.name) args += `\nhostname ${serverInfo.name}`
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/connect_dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function ConnectDialog({open, onClosed}: {open: boolean, onClosed: any})
isOpen={open}
onClose={onClosed}
className="bp5-dark"
title="Connect to a server"
title="Connect to a server via IP"
icon="send-to"
>
<form onSubmit={handleSubmit(connectFormSubmit)}>
Expand Down
9 changes: 8 additions & 1 deletion src/renderer/components/serverbrowser_dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export function ServerBrowserDialog({open, onClosed, onSelectIPConnect, onSelect
const [serverList, setServerList] = useState([])
const [loading, setLoading] = useState(false)
const [status, setStatus] = useState()
const [refreshEnabled, setRefreshEnabled] = useState(true)

async function loadServerList() {
setLoading(true)
Expand All @@ -19,6 +20,12 @@ export function ServerBrowserDialog({open, onClosed, onSelectIPConnect, onSelect
setLoading(false)
}

function doClickRefresh() {
setRefreshEnabled(false)
loadServerList()
setTimeout(() => setRefreshEnabled(true), 1600)
}

useEffect(() => {
loadServerList()
}, [open])
Expand Down Expand Up @@ -47,7 +54,7 @@ export function ServerBrowserDialog({open, onClosed, onSelectIPConnect, onSelect
<DialogFooter
actions={
<>
<Button icon="refresh" onClick={() => loadServerList()}>
<Button icon="refresh" disabled={!refreshEnabled} onClick={() => doClickRefresh()}>
Refresh
</Button>

Expand Down

0 comments on commit 1b4b7ca

Please sign in to comment.