fix: history heading shows when only index is cached
This commit is contained in:
parent
7c949d6030
commit
9e2818004a
1 changed files with 6 additions and 7 deletions
|
@ -28,19 +28,18 @@ const {postDivSelector, skipSave = false} = Astro.props;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const cachedRequests = await cache.keys();
|
const cachedRequests = (await cache.keys())
|
||||||
const list = document.querySelector('#post-list');
|
.filter(request => {
|
||||||
|
const urlObj = new URL(request.url);
|
||||||
|
return urlObj.search !== '';
|
||||||
|
});
|
||||||
|
|
||||||
if(cachedRequests?.length) {
|
if(cachedRequests?.length) {
|
||||||
|
const list = document.querySelector('#post-list');
|
||||||
const heading = document.querySelector('#library span#heading') as HTMLHeadingElement;
|
const heading = document.querySelector('#library span#heading') as HTMLHeadingElement;
|
||||||
heading.innerHTML = 'History';
|
heading.innerHTML = 'History';
|
||||||
|
|
||||||
cachedRequests
|
cachedRequests
|
||||||
// temporary delete all cached errors
|
|
||||||
.filter(request => {
|
|
||||||
const urlObj = new URL(request.url);
|
|
||||||
return urlObj.search !== '';
|
|
||||||
})
|
|
||||||
.reverse()
|
.reverse()
|
||||||
.forEach(async (request) => {
|
.forEach(async (request) => {
|
||||||
const {url} = request;
|
const {url} = request;
|
||||||
|
|
Loading…
Reference in a new issue