mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-11-26 15:37:24 +00:00
Save the tab param to the URL at runtime
This commit is contained in:
parent
d7ba61ebbc
commit
7f72485a04
@ -224,10 +224,13 @@ export default {
|
|||||||
},
|
},
|
||||||
loadTab(index) {
|
loadTab(index) {
|
||||||
this.selectedTab = index;
|
this.selectedTab = index;
|
||||||
|
this.appendQueryToUrl("tab", this.tabs[index].name ?? "videos");
|
||||||
|
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
this.contentItems = this.channel.relatedStreams;
|
this.contentItems = this.channel.relatedStreams;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.tabs[index].content) {
|
if (this.tabs[index].content) {
|
||||||
this.contentItems = this.tabs[index].content;
|
this.contentItems = this.tabs[index].content;
|
||||||
return;
|
return;
|
||||||
|
12
src/main.js
12
src/main.js
@ -251,6 +251,18 @@ const mixin = {
|
|||||||
elem.click();
|
elem.click();
|
||||||
elem.remove();
|
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: {
|
computed: {
|
||||||
authenticated(_this) {
|
authenticated(_this) {
|
||||||
|
Loading…
Reference in New Issue
Block a user