0
0
Fork 0
mirror of https://github.com/VueTubeApp/VueTube synced 2025-01-03 14:11:08 +00:00

add refresh button for home feed

This commit is contained in:
Ethan 2022-03-23 23:55:38 -05:00
parent a27feaf36c
commit c4a6c5688a
2 changed files with 22 additions and 0 deletions

View file

@ -29,6 +29,15 @@
<v-spacer v-if="!search" />
<v-btn
v-show="page == 'Home'"
icon
tile
class="ml-3 mr-1 my-auto fill-height"
style="border-radius: 0.25rem !important"
@click="refreshRecommendations"
><v-icon>mdi-refresh</v-icon></v-btn
>
<v-btn
icon
tile
@ -65,6 +74,18 @@ export default {
data: () => ({
text: "",
}),
methods: {
refreshRecommendations() {
this.$emit("scroll-to-top");
this.$store.commit("updateRecommendedVideos", []);
this.$youtube
.recommend()
.then((result) => {
if (result) this.$store.commit("updateRecommendedVideos", result[0]);
})
.catch((error) => this.$logger("Home Page (Nav Refresh)", error, true));
},
},
};
</script>

View file

@ -6,6 +6,7 @@
@close-search="search = !search"
@search-btn="searchBtn"
@text-changed="textChanged"
@scroll-to-top="$refs.pgscroll.scrollTop = 0"
/>
<div class="accent" style="height: 100%; margin-top: 4rem">