Fix the trending page refresh (#3347)

This commit is contained in:
absidue 2023-03-26 11:32:36 +02:00 committed by GitHub
parent de65e504c9
commit 94f21f293d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 3 deletions

View File

@ -626,6 +626,15 @@ const mutations = {
state.trendingCache[page] = value
},
clearTrendingCache(state) {
state.trendingCache = {
default: null,
music: null,
gaming: null,
movies: null
}
},
setCachedPlaylist(state, value) {
state.cachedPlaylist = value
},

View File

@ -81,7 +81,12 @@ export default defineComponent({
}
},
getTrendingInfo: function () {
getTrendingInfo: function (refresh = false) {
if (refresh) {
this.trendingInstance = null
this.$store.commit('clearTrendingCache')
}
if (!process.env.IS_ELECTRON || this.backendPreference === 'invidious') {
this.getTrendingInfoInvidious()
} else {
@ -184,7 +189,7 @@ export default defineComponent({
case 'r':
case 'R':
if (!this.isLoading) {
this.getTrendingInfo()
this.getTrendingInfo(true)
}
break
}

View File

@ -87,7 +87,7 @@
class="floatingTopButton"
:size="12"
theme="primary"
@click="getTrendingInfo"
@click="getTrendingInfo(true)"
/>
</div>
</template>