Skip to content

Commit

Permalink
Fix display websearch when using tools (#1197)
Browse files Browse the repository at this point in the history
  • Loading branch information
nsarrazin authored May 28, 2024
1 parent a06291e commit 9272495
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/components/chat/ToolUpdate.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import type { ToolFront } from "$lib/types/Tool";
import { page } from "$app/stores";
import { onMount } from "svelte";
import { browser } from "$app/environment";
export let tool: MessageToolUpdate[];
export let loading: boolean = false;
Expand All @@ -26,7 +27,7 @@
let isShowingLoadingBar = false;
onMount(() => {
if (!toolDone && loading) {
if (!toolDone && loading && loadingBarEl) {
loadingBarEl.classList.remove("hidden");
isShowingLoadingBar = true;
animation = loadingBarEl.animate([{ width: "0%" }, { width: "calc(100%+1rem)" }], {
Expand All @@ -39,6 +40,8 @@
// go to 100% quickly if loading is done
$: (!loading || toolDone) &&
browser &&
loadingBarEl &&
isShowingLoadingBar &&
(() => {
isShowingLoadingBar = false;
Expand Down

0 comments on commit 9272495

Please sign in to comment.