From 29f2fa470392d87ebc55f751c7a036ef3cf050bd Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 6 Dec 2025 01:39:37 +0400 Subject: [PATCH] fix: prevent instant plans from breaking after customization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed multiple issues: 1. Enhanced closeInstantCustomization to properly reset state 2. Clear customization containers and config state 3. Re-render instant servers when returning from customize 4. Fixed tab switching to preserve instant server selection 5. Auto-select first instant server when switching back to instant tab Now instant plans work correctly: - After customizing, clicking back returns to instant grid - Switching tabs preserves instant server functionality - Selected server state is properly maintained 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../new-baremetal.html | 46 ++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/Documents/Vibe Coding Projects/dedicatednodes-redesign/dedicatednodes-bare-metal/new-baremetal.html b/Documents/Vibe Coding Projects/dedicatednodes-redesign/dedicatednodes-bare-metal/new-baremetal.html index 8ab6aa4..2d0b3c4 100644 --- a/Documents/Vibe Coding Projects/dedicatednodes-redesign/dedicatednodes-bare-metal/new-baremetal.html +++ b/Documents/Vibe Coding Projects/dedicatednodes-redesign/dedicatednodes-bare-metal/new-baremetal.html @@ -4122,7 +4122,27 @@ var wpcf7 = { isInstantCustomized = false; document.getElementById('instantOptions').style.display = 'none'; document.getElementById('instantServersGrid').style.display = 'grid'; + + // Clear the customization container to avoid conflicts + const instantContainer = document.getElementById('instantDynamicConfigContainer'); + if (instantContainer) instantContainer.innerHTML = ''; + + // Reset config state to clean values + configState = {}; + configIds = {}; + storageSelection = {}; + + // Clear any original drives tracking + if (window.originalDrives) { + window.originalDrives = []; + } + + // Re-render the instant servers grid to ensure proper display + renderInstantServers(); + + // Update summary and specs for the selected instant server updateSummary(); + updateSpecs(selectedServer); } // Customize Instant Server Button Logic @@ -5332,8 +5352,32 @@ var wpcf7 = { document.getElementById('instant-content').classList.toggle('active', currentTab === 'instant'); document.getElementById('custom-content').classList.toggle('active', currentTab === 'custom'); - selectedServer = null; + // Reset customization state when switching + isInstantCustomized = false; + document.getElementById('instantOptions').style.display = 'none'; + document.getElementById('instantServersGrid').style.display = 'grid'; document.getElementById('customOptions').style.display = 'none'; + + // Clear containers + const instantContainer = document.getElementById('instantDynamicConfigContainer'); + if (instantContainer) instantContainer.innerHTML = ''; + + // Reset config state + configState = {}; + configIds = {}; + storageSelection = {}; + + // If switching back to instant tab, re-render instant servers + if (currentTab === 'instant') { + renderInstantServers(); + // Auto-select first instant server if none selected + if (!selectedServer && instantServers.length > 0) { + selectInstantServer(instantServers[0].id); + } + } else { + selectedServer = null; + } + updateSummary(); }); });