From 7c9fccc683120cb630dbcc41fa5df4a172a50204 Mon Sep 17 00:00:00 2001 From: MCHost Date: Sun, 6 Jul 2025 21:38:59 -0400 Subject: [PATCH] fix start button to reenable restart button --- public/js/app.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/public/js/app.js b/public/js/app.js index d26fd3d..4f1fafe 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -2181,8 +2181,13 @@ function updateModListPagination() { state.serverStatus = message.data?.status || 'Unknown'; elements.serverStatus.textContent = state.serverStatus; toggleSections(state.serverStatus); - if (message.data?.status === 'running') { + if (message.data?.status.toLowerCase() === 'running') { updateNotification(notification, 'Server started successfully', 'success', key); + // Ensure restart button is enabled + if (elements.restartBtn) { + elements.restartBtn.disabled = false; + elements.restartBtn.classList.remove('disabled-btn'); + } ws.removeEventListener('message', messageHandler); } } @@ -2194,7 +2199,7 @@ function updateModListPagination() { setTimeout(() => { if (ws && ws.readyState === WebSocket.OPEN) { ws.removeEventListener('message', messageHandler); - if (state.serverStatus !== 'running') { + if (state.serverStatus.toLowerCase() !== 'running') { updateNotification(notification, 'Failed to start server. Please try again.', 'error', key); toggleSections(state.serverStatus); }