From 26fbc4517423e103c155914ecea69ab07a897217 Mon Sep 17 00:00:00 2001 From: SPGoding Date: Wed, 18 Dec 2019 17:57:50 -0600 Subject: [PATCH] Add a fallback in case that the pathname is wrong --- view.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view.js b/view.js index 925b7b82..0ab68e71 100644 --- a/view.js +++ b/view.js @@ -10,7 +10,7 @@ function changeVersion(version) { structure = json.root; } else if (json.roots) { let id = window.location.pathname.replace(/\/$/, '').replace(/^\//, ''); - structure = json.roots.find(e => e.id === id); + structure = json.roots.find(e => e.id === id) || json.roots[0] ; } components = json.components; collections = json.collections;