perf: use structuredClone for message deep copies (#21948)
This commit is contained in:
1 parent
9440d09114
commit
54cefedf53
2 files changed
+5
-5
No files matched your search
@@ -60,10 +60,10 @@
|
||||
|
||||
let selectedModelIdx = null;
|
||||
|
||||
let message = JSON.parse(JSON.stringify(history.messages[messageId]));
|
||||
let message = structuredClone(history.messages[messageId]);
|
||||
$: if (history.messages) {
|
||||
if (JSON.stringify(message) !== JSON.stringify(history.messages[messageId])) {
|
||||
message = JSON.parse(JSON.stringify(history.messages[messageId]));
|
||||
message = structuredClone(history.messages[messageId]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user