Fix console showing endless loading when logs are empty
All checks were successful
Deploy GSM / deploy (push) Successful in 23s
All checks were successful
Deploy GSM / deploy (push) Successful in 23s
Changed logs state initialization from empty string to null to properly distinguish between "not yet loaded" and "loaded but empty" states. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -10,7 +10,7 @@ export default function ServerDetailModal({ server, onClose, onUpdate }) {
|
||||
const [activeTab, setActiveTab] = useState('overview')
|
||||
const [rconCommand, setRconCommand] = useState('')
|
||||
const [rconHistory, setRconHistory] = useState([])
|
||||
const [logs, setLogs] = useState('')
|
||||
const [logs, setLogs] = useState(null)
|
||||
const logsRef = useRef(null)
|
||||
const rconRef = useRef(null)
|
||||
|
||||
@@ -299,7 +299,7 @@ export default function ServerDetailModal({ server, onClose, onUpdate }) {
|
||||
ref={logsRef}
|
||||
className="terminal rounded h-96 overflow-y-auto p-4 font-mono text-xs text-[#00ff41]/80 whitespace-pre-wrap"
|
||||
>
|
||||
{logs || 'Loading...'}
|
||||
{logs === null ? 'Loading...' : (logs || 'Keine Logs verfügbar')}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -31,7 +31,7 @@ export default function ServerDetail() {
|
||||
const [activeTab, setActiveTab] = useState('overview')
|
||||
const [rconCommand, setRconCommand] = useState('')
|
||||
const [rconHistory, setRconHistory] = useState([])
|
||||
const [logs, setLogs] = useState('')
|
||||
const [logs, setLogs] = useState(null)
|
||||
const [whitelistPlayers, setWhitelistPlayers] = useState([])
|
||||
|
||||
const [whitelistInput, setWhitelistInput] = useState('')
|
||||
@@ -517,7 +517,7 @@ const formatUptime = (seconds) => {
|
||||
ref={logsRef}
|
||||
className="terminal p-4 logs-container text-xs text-neutral-300 whitespace-pre-wrap"
|
||||
>
|
||||
{logs || 'Laden...'}
|
||||
{logs === null ? 'Laden...' : (logs || 'Keine Logs verfügbar')}
|
||||
</div>
|
||||
|
||||
{/* RCON History */}
|
||||
|
||||
Reference in New Issue
Block a user