]> Lady’s Gitweb - x_status_git/blobdiff - status.html
Retry without cache if loading a status fails
[x_status_git] / status.html
index 11425551df859f5f1703c328a1596218cb1e15c4..e1c68ad306aab8e9c17d026b9868d51f668205da 100644 (file)
@@ -15,8 +15,13 @@ footer small{ Font-Size: Inherit; Font-Style: Italic }
 <BODY>
 <SCRIPT Type=module>
 const parser = new DOMParser
-fetch(`${new URL(".", location).toString().slice(0, -1)}.jsonld`)
+const index = `${new URL(".", location).toString().slice(0, -1)}.jsonld`
+fetch(index)
 .then($ => $.json())
+.then(meta => {
+  const { items } = meta
+  if (items.find($ => new URL($["@id"]).pathname === location.pathname)) return meta
+  else return fetch(index, { cache: "reload" }).then($ => $.json()) })
 .then(meta => {
   const { items, subject } = meta
   const n = items.findIndex($ => new URL($["@id"]).pathname === location.pathname)
This page took 0.022374 seconds and 4 git commands to generate.