diff --git a/src/components/ChannelPage.vue b/src/components/ChannelPage.vue index 4bce5531..95bbdeef 100644 --- a/src/components/ChannelPage.vue +++ b/src/components/ChannelPage.vue @@ -224,7 +224,11 @@ export default { }, loadTab(index) { this.selectedTab = index; - this.appendQueryToUrl("tab", this.tabs[index].name ?? "videos"); + + // update the tab query in the url path + const url = new URL(window.location); + url.searchParams.set("tab", this.tabs[index].name ?? "videos"); + window.history.replaceState(window.history.state, "", url); if (index == 0) { this.contentItems = this.channel.relatedStreams; diff --git a/src/main.js b/src/main.js index 67538926..12cf63ef 100644 --- a/src/main.js +++ b/src/main.js @@ -251,18 +251,6 @@ const mixin = { elem.click(); elem.remove(); }, - appendQueryToUrl(key, value) { - let searchParams = new URLSearchParams(window.location.search); - searchParams.set(key, value); - let newurl = - window.location.protocol + - "//" + - window.location.host + - window.location.pathname + - "?" + - searchParams.toString(); - window.history.pushState({ path: newurl }, "", newurl); - }, }, computed: { authenticated(_this) {