Skip to content

Commit ebdaa01

Browse files
committed
fix: remove duplicated code causing parsing error in history panel (main.js)
1 parent 6077e03 commit ebdaa01

1 file changed

Lines changed: 3 additions & 14 deletions

File tree

src/js/main.js

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import "../css/main.css"; // Tailwind CSS
99

1010
// Error Handling
11-
import { initGlobalErrorHandlers, handleError, showSuccessNotification } from "./error-handler.js";
11+
import { initGlobalErrorHandlers } from "./error-handler.js";
1212

1313
// Core Imports
1414
import { initTheme, createThemeToggle, getEffectiveTheme } from "./theme.js";
@@ -20,7 +20,6 @@ import { calculateVLSM, calculateTotalRequired, calculateTotalAvailable } from "
2020
import {
2121
displayResults,
2222
showError,
23-
clearResults,
2423
showToast,
2524
createHistoryPanel,
2625
updateHistoryPanel,
@@ -34,11 +33,8 @@ import {
3433
} from "./history.js";
3534
import { trackCalculation } from "./analytics.js";
3635

37-
// Global State
38-
const AppState = {
39-
currentTool: "tool-dashboard",
40-
initializedTools: new Set(),
41-
};
36+
// Global State (reserved for future uses)
37+
// const AppState = { currentTool: "tool-dashboard", initializedTools: new Set() };
4238

4339
/**
4440
* Tool Configuration Map
@@ -454,12 +450,6 @@ function setupGlobalActions() {
454450

455451
// Go to dashboard/VLSM view
456452
showView("view-vlsm", "VLSM CALCULATOR");
457-
458-
// Re-run calculation (or just display stored results)
459-
const btn = document.getElementById("btn-calc-vlsm");
460-
if (btn) btn.click();
461-
462-
// Close panel
463453
panel.classList.remove("open");
464454
overlay.classList.remove("active");
465455
},
@@ -498,7 +488,6 @@ function setupGlobalActions() {
498488
// Append Panel & Overlay to Body (outside header)
499489
document.body.appendChild(overlay);
500490
document.body.appendChild(panel);
501-
502491
// Add History Button to Header
503492
const historyBtn = document.createElement("button");
504493
historyBtn.className = "btn btn-outline-info btn-sm me-2";

0 commit comments

Comments
 (0)