diff --git a/src/components/Library.astro b/src/components/Library.astro index 2144892..930acaa 100644 --- a/src/components/Library.astro +++ b/src/components/Library.astro @@ -28,19 +28,18 @@ const {postDivSelector, skipSave = false} = Astro.props; } } - const cachedRequests = await cache.keys(); - const list = document.querySelector('#post-list'); + const cachedRequests = (await cache.keys()) + .filter(request => { + const urlObj = new URL(request.url); + return urlObj.search !== ''; + }); if(cachedRequests?.length) { + const list = document.querySelector('#post-list'); const heading = document.querySelector('#library span#heading') as HTMLHeadingElement; heading.innerHTML = 'History'; cachedRequests - // temporary delete all cached errors - .filter(request => { - const urlObj = new URL(request.url); - return urlObj.search !== ''; - }) .reverse() .forEach(async (request) => { const {url} = request;