From 287c1d2c4e5348ba632da85df1526c1943cfc1b3 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 22 Feb 2022 19:09:51 +0100 Subject: [PATCH] wip #5120 --- resources/js/search.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/js/search.js b/resources/js/search.js index 7fa9204..020c6cc 100644 --- a/resources/js/search.js +++ b/resources/js/search.js @@ -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; -- 2.39.5