mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-11-10 02:08:21 +00:00
Merge pull request #2629 from Bnyro/default-homepage-fix
Open default homepage directly on navbar icon click
This commit is contained in:
commit
b18e964dc5
@ -1,14 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<nav class="flex flex-wrap items-center justify-center px-2 sm:px-4 pb-2.5 w-full relative">
|
<nav class="flex flex-wrap items-center justify-center px-2 sm:px-4 pb-2.5 w-full relative">
|
||||||
<div class="flex-1 flex justify-start">
|
<div class="flex-1 flex justify-start">
|
||||||
<router-link class="flex font-bold text-3xl items-center font-sans" to="/"
|
<span class="flex font-bold text-3xl items-center font-sans cursor-pointer" @click="openHomePage(this)"
|
||||||
><img
|
><img alt="logo" src="/img/icons/logo.svg" height="32" width="32" class="w-10 mr-[-0.6rem]" />iped</span
|
||||||
alt="logo"
|
|
||||||
src="/img/icons/logo.svg"
|
|
||||||
height="32"
|
|
||||||
width="32"
|
|
||||||
class="w-10 mr-[-0.6rem]"
|
|
||||||
/>iped</router-link
|
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<div class="lt-md:hidden search-container">
|
<div class="lt-md:hidden search-container">
|
||||||
|
@ -34,17 +34,7 @@ export default {
|
|||||||
activated() {
|
activated() {
|
||||||
document.title = this.$t("titles.trending") + " - Piped";
|
document.title = this.$t("titles.trending") + " - Piped";
|
||||||
if (this.videos.length > 0) this.updateWatched(this.videos);
|
if (this.videos.length > 0) this.updateWatched(this.videos);
|
||||||
if (this.$route.path == "/") {
|
if (this.$route.path == "/") this.openHomePage(this);
|
||||||
switch (this.getPreferenceString("homepage", "trending")) {
|
|
||||||
case "trending":
|
|
||||||
break;
|
|
||||||
case "feed":
|
|
||||||
this.$router.push("/feed");
|
|
||||||
return;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async fetchTrending(region) {
|
async fetchTrending(region) {
|
||||||
|
14
src/main.js
14
src/main.js
@ -532,6 +532,20 @@ const mixin = {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
openHomePage(_this) {
|
||||||
|
let route;
|
||||||
|
switch (_this.getPreferenceString("homepage", "trending")) {
|
||||||
|
case "trending":
|
||||||
|
route = "/trending";
|
||||||
|
break;
|
||||||
|
case "feed":
|
||||||
|
route = "/feed";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (route !== undefined) _this.$router.push(route);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
authenticated(_this) {
|
authenticated(_this) {
|
||||||
|
Loading…
Reference in New Issue
Block a user