fix(web): added proper fallbacks for missing hash and device_id

This commit is contained in:
Marcin Mennemann
2026-05-18 22:21:28 +02:00
committed by Tobias Gesellchen
parent ff279a150f
commit fbbc0de55c
+10 -6
View File
@@ -530,11 +530,13 @@ function openTab(evt, tabId) {
window.addEventListener('popstate', function() {
const hash = window.location.hash.slice(1);
const [tabId, extra] = hash.split('?');
if (tabId && document.getElementById(tabId)) {
openTab(null, tabId);
if (tabId === "tab-migration" && extra) {
selectMigrationDevice(extra);
}
if (!tabId || !document.getElementById(tabId)) {
openTab(null, "tab-overview");
return;
}
openTab(null, tabId);
if (tabId === "tab-migration") {
selectMigrationDevice(extra);
}
});
@@ -548,6 +550,8 @@ function selectMigrationDevice(deviceId) {
return;
}
}
sel.value = "";
document.getElementById("migration-summary").style.display = "none";
}
}
@@ -1589,7 +1593,7 @@ document.addEventListener("DOMContentLoaded", async () => {
const [tabId, extra] = hash.split('?');
if (tabId && document.getElementById(tabId)) {
openTab(null, tabId);
if (tabId === "tab-migration" && extra) {
if (tabId === "tab-migration") {
selectMigrationDevice(extra);
}
}