From c4a6c5688aba35a4d89b2ce9985d741dc66dc4d5 Mon Sep 17 00:00:00 2001 From: Ethan Date: Wed, 23 Mar 2022 23:55:38 -0500 Subject: [PATCH] add refresh button for home feed --- NUXT/components/topNavigation.vue | 21 +++++++++++++++++++++ NUXT/layouts/default.vue | 1 + 2 files changed, 22 insertions(+) diff --git a/NUXT/components/topNavigation.vue b/NUXT/components/topNavigation.vue index fb68dbe..ceaa8bb 100644 --- a/NUXT/components/topNavigation.vue +++ b/NUXT/components/topNavigation.vue @@ -29,6 +29,15 @@ + mdi-refresh ({ 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)); + }, + }, }; diff --git a/NUXT/layouts/default.vue b/NUXT/layouts/default.vue index fa842ed..2f84176 100644 --- a/NUXT/layouts/default.vue +++ b/NUXT/layouts/default.vue @@ -6,6 +6,7 @@ @close-search="search = !search" @search-btn="searchBtn" @text-changed="textChanged" + @scroll-to-top="$refs.pgscroll.scrollTop = 0" />