diff --git a/src/components/DxpGitBookSearch.vue b/src/components/DxpGitBookSearch.vue index 80ad901..f278f97 100644 --- a/src/components/DxpGitBookSearch.vue +++ b/src/components/DxpGitBookSearch.vue @@ -5,7 +5,7 @@ - + @@ -230,7 +230,7 @@ async function fetchSources() { isResourceLoading.value = true; const list = [] as any; - const responses = await Promise.all(answer.value.sources.map((source: any) => { + const responses = await (Promise as any).allSettled(answer.value.sources.map((source: any) => { if(source.type === "page") { return gitBookContext.getGitBookPage({ pageId: source.page, @@ -260,4 +260,17 @@ function searchRelatedQuestion(question: string) { queryString.value = question; askQuery() } + +function clearQueryState() { + selectedSegment.value = "search"; + queryString.value = ""; + searchedItems.value = []; + answer.value = {}; + + isLoading.value = false; + + isResourceLoading.value = false; + sources.value = []; + isResourceFetched.value = false; +} \ No newline at end of file