Skip to content

Commit 9272495

Browse files
authored
Fix display websearch when using tools (#1197)
1 parent a06291e commit 9272495

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/lib/components/chat/ToolUpdate.svelte

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import type { ToolFront } from "$lib/types/Tool";
1212
import { page } from "$app/stores";
1313
import { onMount } from "svelte";
14+
import { browser } from "$app/environment";
1415
1516
export let tool: MessageToolUpdate[];
1617
export let loading: boolean = false;
@@ -26,7 +27,7 @@
2627
2728
let isShowingLoadingBar = false;
2829
onMount(() => {
29-
if (!toolDone && loading) {
30+
if (!toolDone && loading && loadingBarEl) {
3031
loadingBarEl.classList.remove("hidden");
3132
isShowingLoadingBar = true;
3233
animation = loadingBarEl.animate([{ width: "0%" }, { width: "calc(100%+1rem)" }], {
@@ -39,6 +40,8 @@
3940
4041
// go to 100% quickly if loading is done
4142
$: (!loading || toolDone) &&
43+
browser &&
44+
loadingBarEl &&
4245
isShowingLoadingBar &&
4346
(() => {
4447
isShowingLoadingBar = false;

0 commit comments

Comments
 (0)