Load versions.json as a resource if we're in the unstable spec (#2258)

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
pull/2259/head
Johannes Marbach 3 weeks ago committed by GitHub
parent a5afe542c0
commit 22c0952003
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -82,7 +82,14 @@ function appendVersion(parent, name, url) {
a.appendChild(text);
}
fetch("/latest/versions.json")
// If we're in the unstable version, we're the latest thing and can just load
// versions.json from our own resources. Otherwise, we fall back to loading it
// from /unstable/versions.json, assuming we are on the spec.matrix.org deployment.
const url = currentVersion === "unstable"
? '{{ "/" | relURL }}versions.json'
: "/unstable/versions.json";
fetch(url)
.then(r => r.json())
.then(versions => {
// Find the surrounding list element

@ -0,0 +1 @@
Add version picker in the navbar.
Loading…
Cancel
Save