[FEATURE] Fix RCON Connectoin Display

This commit is contained in:
Dunemask 2024-02-04 18:31:04 -07:00
parent 3c6f31f6d7
commit e65e085011
2 changed files with 7 additions and 3 deletions

View file

@ -8,6 +8,7 @@ export default class RconSocket {
this.sk.on("rcon-error", this.onRconError.bind(this));
this.sk.on("error", () => console.log("WHOOSPSIE I GUESS?"));
this.rconLive = false;
this.rconError = false;
}
onPush(p) {
@ -22,6 +23,7 @@ export default class RconSocket {
onRconError(v) {
this.rconLive = false;
this.rconError = true;
console.log("Server sent: ", v);
}

View file

@ -55,10 +55,12 @@ export default function RconView(props) {
variant="outlined"
value={cmd}
onChange={updateCmd}
disabled={!(rcon && rcon.rconLive)}
disabled={!(rcon && rcon.rconLive && !rcon.rconError)}
/>
{rcon && rcon.rconLive && <Button onClick={sendCommand}>Send</Button>}
{!(rcon && rcon.rconLive) && (
{rcon && rcon.rconLive && !rcon.rconError && (
<Button onClick={sendCommand}>Send</Button>
)}
{!(rcon && rcon.rconLive && !rcon.rconError) && (
<Button color="secondary">Not Connected</Button>
)}
</Box>