mirror of
https://github.com/gradio-app/gradio.git
synced 2025-03-25 12:10:31 +08:00
Quick fix: Chatbot change event (#5827)
* fix * add changeset * add dequal to dependency * package * lint --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com> Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
This commit is contained in:
parent
7b63db2716
commit
48e09ee887
6
.changeset/open-points-sort.md
Normal file
6
.changeset/open-points-sort.md
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
"@gradio/chatbot": patch
|
||||
"gradio": patch
|
||||
---
|
||||
|
||||
fix:Quick fix: Chatbot change event
|
@ -17,7 +17,8 @@
|
||||
"@gradio/utils": "workspace:^",
|
||||
"@types/dompurify": "^3.0.2",
|
||||
"@types/katex": "^0.16.0",
|
||||
"@types/prismjs": "1.26.1"
|
||||
"@types/prismjs": "1.26.1",
|
||||
"dequal": "^2.0.2"
|
||||
},
|
||||
"main_changeset": true,
|
||||
"exports": {
|
||||
|
@ -2,6 +2,7 @@
|
||||
import { format_chat_for_sharing } from "../utils";
|
||||
import { copy } from "@gradio/utils";
|
||||
|
||||
import { dequal } from "dequal/lite";
|
||||
import { beforeUpdate, afterUpdate, createEventDispatcher } from "svelte";
|
||||
import { ShareButton } from "@gradio/atoms";
|
||||
import type { SelectData, LikeData } from "@gradio/utils";
|
||||
@ -68,7 +69,7 @@
|
||||
});
|
||||
|
||||
$: {
|
||||
if (value !== old_value) {
|
||||
if (!dequal(value, old_value)) {
|
||||
old_value = value;
|
||||
dispatch("change");
|
||||
}
|
||||
@ -81,7 +82,7 @@
|
||||
): void {
|
||||
dispatch("select", {
|
||||
index: [i, j],
|
||||
value: message,
|
||||
value: message
|
||||
});
|
||||
}
|
||||
|
||||
@ -94,7 +95,7 @@
|
||||
dispatch("like", {
|
||||
index: [i, j],
|
||||
value: message,
|
||||
liked: liked,
|
||||
liked: liked
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
5
pnpm-lock.yaml
generated
5
pnpm-lock.yaml
generated
@ -601,6 +601,9 @@ importers:
|
||||
'@types/prismjs':
|
||||
specifier: 1.26.1
|
||||
version: 1.26.1
|
||||
dequal:
|
||||
specifier: ^2.0.2
|
||||
version: 2.0.2
|
||||
|
||||
js/checkbox:
|
||||
dependencies:
|
||||
@ -6437,7 +6440,7 @@ packages:
|
||||
peerDependencies:
|
||||
'@sveltejs/kit': ^1.0.0
|
||||
dependencies:
|
||||
'@sveltejs/kit': 1.16.3(svelte@3.59.2)(vite@4.3.9)
|
||||
'@sveltejs/kit': 1.16.3(svelte@3.57.0)(vite@4.3.5)
|
||||
import-meta-resolve: 3.0.0
|
||||
dev: true
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user