mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-12-23 05:53:36 +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>
|
||||
<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">
|
||||
<router-link class="flex font-bold text-3xl items-center font-sans" to="/"
|
||||
><img
|
||||
alt="logo"
|
||||
src="/img/icons/logo.svg"
|
||||
height="32"
|
||||
width="32"
|
||||
class="w-10 mr-[-0.6rem]"
|
||||
/>iped</router-link
|
||||
<span class="flex font-bold text-3xl items-center font-sans cursor-pointer" @click="openHomePage(this)"
|
||||
><img alt="logo" src="/img/icons/logo.svg" height="32" width="32" class="w-10 mr-[-0.6rem]" />iped</span
|
||||
>
|
||||
</div>
|
||||
<div class="lt-md:hidden search-container">
|
||||
|
@ -34,17 +34,7 @@ export default {
|
||||
activated() {
|
||||
document.title = this.$t("titles.trending") + " - Piped";
|
||||
if (this.videos.length > 0) this.updateWatched(this.videos);
|
||||
if (this.$route.path == "/") {
|
||||
switch (this.getPreferenceString("homepage", "trending")) {
|
||||
case "trending":
|
||||
break;
|
||||
case "feed":
|
||||
this.$router.push("/feed");
|
||||
return;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (this.$route.path == "/") this.openHomePage(this);
|
||||
},
|
||||
methods: {
|
||||
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: {
|
||||
authenticated(_this) {
|
||||
|
Loading…
Reference in New Issue
Block a user