From 56ea7424955f95382114b53e7c1e5cb51fceaa55 Mon Sep 17 00:00:00 2001 From: Myron Blair Date: Thu, 4 Jun 2026 18:49:57 +0000 Subject: [PATCH] Fix add new game: reset form on section load, add prominent Add New Game button - resetGameForm() now called every time Game Management section is opened, preventing stuck edit state (disabled slug, wrong form title) - Added prominent Add New Game button at top of section (master admin only) - DOMContentLoaded init ensures form state is correct on page load Co-Authored-By: Claude Sonnet 4.6 --- admin/index.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/admin/index.php b/admin/index.php index 39c3580..c34891f 100644 --- a/admin/index.php +++ b/admin/index.php @@ -772,7 +772,14 @@ tr:hover td{background:rgba(255,255,255,.015)}
-
🕹️ Game Management
+
+
🕹️ Game Management
+ + + +
@@ -1172,8 +1179,8 @@ loadStats(); loadPurchases('pending'); loadCashouts('pending'); loadUsers(); -// Initialize game form state on page load -if (typeof resetGameForm === 'function') resetGameForm(); +// Initialize game form once DOM is ready +document.addEventListener('DOMContentLoaded', () => resetGameForm()); async function loadStats() { const d = await apiFetch('stats'); @@ -3428,7 +3435,7 @@ function showSec(name) { if (name === 'referrals') { loadAdminReferrals('pending', document.querySelector('#section-referrals .ftab')); } if (name === 'platform-accounts') loadPlatformAccountRequests('pending', document.querySelector('#section-platform-accounts .ftab')); if (name === 'broadcasts') loadBroadcasts(); - if (name === 'games') { loadGames(); loadArchivedGames(); } + if (name === 'games') { loadGames(); loadArchivedGames(); resetGameForm(); } if (name === 'payments') loadPaymentSettings(); if (name === 'payout-settings') loadPayoutSettings(); if (name === 'cashout-methods') loadCashoutMethods();