Fix timeline cache issue
parent
0dfbcdce4f
commit
05e0d7818d
|
@ -499,6 +499,7 @@ export default class Timeline extends Mixins(GlobalMixin, UserConfig) {
|
||||||
async fetchDays(noCache=false) {
|
async fetchDays(noCache=false) {
|
||||||
let params: any = {};
|
let params: any = {};
|
||||||
let url = generateUrl(this.appendQuery('/apps/memories/api/days'), params);
|
let url = generateUrl(this.appendQuery('/apps/memories/api/days'), params);
|
||||||
|
const cacheUrl = this.$route.name + url;
|
||||||
|
|
||||||
// Try cache first
|
// Try cache first
|
||||||
let cache: IDay[];
|
let cache: IDay[];
|
||||||
|
@ -519,7 +520,7 @@ export default class Timeline extends Mixins(GlobalMixin, UserConfig) {
|
||||||
data = await dav.getPeopleData();
|
data = await dav.getPeopleData();
|
||||||
} else {
|
} else {
|
||||||
// Try the cache
|
// Try the cache
|
||||||
cache = noCache ? null : (await utils.getCachedData(url));
|
cache = noCache ? null : (await utils.getCachedData(cacheUrl));
|
||||||
if (cache) {
|
if (cache) {
|
||||||
await this.processDays(cache);
|
await this.processDays(cache);
|
||||||
this.loading--;
|
this.loading--;
|
||||||
|
@ -530,7 +531,7 @@ export default class Timeline extends Mixins(GlobalMixin, UserConfig) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Put back into cache
|
// Put back into cache
|
||||||
utils.cacheData(url, data);
|
utils.cacheData(cacheUrl, data);
|
||||||
|
|
||||||
// Make sure we're still on the same page
|
// Make sure we're still on the same page
|
||||||
if (this.state !== startState) return;
|
if (this.state !== startState) return;
|
||||||
|
|
Loading…
Reference in New Issue