mirror of
https://github.com/gesellix/Bose-SoundTouch.git
synced 2026-08-19 00:56:16 +00:00
fix(web): added proper fallbacks for missing hash and device_id
This commit is contained in:
committed by
Tobias Gesellchen
parent
ff279a150f
commit
fbbc0de55c
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user