mirror of https://github.com/FreeTubeApp/FreeTube
Fix the trending page refresh (#3347)
This commit is contained in:
parent
de65e504c9
commit
94f21f293d
|
@ -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
|
||||
},
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -87,7 +87,7 @@
|
|||
class="floatingTopButton"
|
||||
:size="12"
|
||||
theme="primary"
|
||||
@click="getTrendingInfo"
|
||||
@click="getTrendingInfo(true)"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
|
Loading…
Reference in New Issue