Add router caching. (#248)

* Add router caching.

* Avoid memory leak by limiting cache size.

* Fix search result caching.

* Remove remains of previous player.

Fixes an issue where the spinner/loading from a previous player can show up in a cached page.
This commit is contained in:
FireMasterK
2021-07-07 19:48:09 +05:30
committed by GitHub
parent 9345e1a917
commit b0d9145e75
6 changed files with 36 additions and 21 deletions

View File

@@ -86,16 +86,13 @@ export default {
},
mounted() {
this.updateResults();
},
activated() {
window.addEventListener("scroll", this.handleScroll);
},
unmounted() {
deactivated() {
window.removeEventListener("scroll", this.handleScroll);
},
watch: {
"$route.query.search_query": function(q) {
if (q) this.updateResults();
},
},
methods: {
async fetchResults() {
return await await this.fetchJson(this.apiUrl() + "/search", {