From 48e8ff8352be66a365173f76acd038ec2f1f445b Mon Sep 17 00:00:00 2001 From: Tobias Gesellchen Date: Mon, 18 May 2026 22:12:52 +0200 Subject: [PATCH] fix(web): guard pushState in showSummary to break popstate loop skip history.pushState when the hash already matches, so popstate -> selectMigrationDevice -> showSummary no longer pushes a duplicate entry that traps browser-Back in an oscillation between identical `#tab-migration?` entries. --- pkg/service/handlers/web/js/script.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/service/handlers/web/js/script.js b/pkg/service/handlers/web/js/script.js index 83a2205..294d771 100644 --- a/pkg/service/handlers/web/js/script.js +++ b/pkg/service/handlers/web/js/script.js @@ -1743,7 +1743,10 @@ async function showSummary(deviceId) { document.getElementById("migration-summary").style.display = "none"; return; } - history.pushState(null, '', '#tab-migration?' + deviceId); + const newHash = '#tab-migration?' + deviceId; + if (window.location.hash !== newHash) { + history.pushState(null, '', newHash); + } const targetUrl = document.getElementById("target-domain").value; // Per-field URL overrides (Plan card). The summary endpoint uses