always use server.running as boolean

This commit is contained in:
jannaahs 2022-01-01 12:25:59 +01:00
parent 62ea775690
commit 6de3872b2b
3 changed files with 6 additions and 7 deletions

View File

@ -7,7 +7,6 @@ const Console = ({serverStatus}) => {
const [logs, setLogs] = useState([]);
const consoleInput = useRef(null);
const isRunning = serverStatus.status === 'running';
useEffect(() => {
@ -29,7 +28,7 @@ const Console = ({serverStatus}) => {
<Panel
title="Console"
content={
isRunning
serverStatus.running
? <>
<ul>
{logs?.map((log, i) => (<li key={i}>{log}</li>))}

View File

@ -103,7 +103,7 @@ const Mods = ({serverStatus}) => {
.then(fetchInstalledMods)
}
let disabled = serverStatus.status !== "stopped"
let disabled = serverStatus.running
return (
<div>

View File

@ -38,7 +38,7 @@ const Saves = ({serverStatus}) => {
title="Create Save"
className="lg:w-1/2 lg:mr-3 mb-6 lg:mb-0"
content={
serverStatus.status === "running"
serverStatus.running
? <p className="text-red-light pt-4 pb-24">
Create a new Save is only possible if the Factorio server is
not running.