]> _ Git - odl.git/commitdiff
wip #5120
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 22 Feb 2022 18:09:51 +0000 (19:09 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 22 Feb 2022 18:09:51 +0000 (19:09 +0100)
resources/js/search.js

index 7fa920436f797062b6dea90df447097cedbb548e..020c6cc156082157b12cd86990b54dc537bf956b 100644 (file)
@@ -19,11 +19,13 @@ export default () => ({
 
     async init() {
         // We need the URL from the HTML because it gets properly updated when exporting the final version
-        const data = await (await fetch(this.$el.dataset.searchindex));
+        const data = await fetch(this.$el.dataset.searchindex);
+        const index = await data.text();
+        console.log(index);
 
         // Delay miniSearch initialisation so there's less chance of animations stuttering during page loads
         setTimeout(() => {
-            window.minisearch = this.miniSearch = MiniSearch.loadJSON(data.text(), this.setup);
+            window.minisearch = this.miniSearch = MiniSearch.loadJSON(index, this.setup);
         }, 4000);
 
         this.medialibrary = this.$el.dataset.medialibrary;