diff --git a/public/app.js b/public/app.js index f58cf8fe..5f8eeded 100644 --- a/public/app.js +++ b/public/app.js @@ -464,7 +464,7 @@ window.addEventListener('DOMContentLoaded', () => { const chList = Array.isArray(channels) ? channels : []; for (const c of chList) { if (c.name && c.name.toLowerCase().includes(q.toLowerCase())) { - html += `
+ html += `
Channel${c.name}
`; } } diff --git a/public/channels.js b/public/channels.js index 5731a9d8..ad3fc0e3 100644 --- a/public/channels.js +++ b/public/channels.js @@ -211,7 +211,7 @@ }); } - function init(app) { + function init(app, routeParam) { app.innerHTML = `
@@ -235,7 +235,9 @@
`; - loadChannels(); + loadChannels().then(() => { + if (routeParam) selectChannel(routeParam); + }); // #89: Sidebar resize handle (function () { @@ -438,6 +440,7 @@ async function selectChannel(hash) { selectedHash = hash; + history.replaceState(null, '', `#/channels/${hash}`); renderChannelList(); const ch = channels.find(c => c.hash === hash); const name = ch?.name || `Channel ${hash}`;