perf: replace JSON.stringify equality with fast-deep-equal (#23370)
This commit is contained in:
1 parent
c5276f62d0
commit
e5f31c2e14
6 files changed
+10
-8
No files matched your search
@@ -19,6 +19,7 @@
|
||||
import localizedFormat from 'dayjs/plugin/localizedFormat';
|
||||
import ProfileImage from './ProfileImage.svelte';
|
||||
import { WEBUI_BASE_URL } from '$lib/constants';
|
||||
import equal from 'fast-deep-equal';
|
||||
const i18n = getContext('i18n');
|
||||
dayjs.extend(localizedFormat);
|
||||
|
||||
@@ -66,7 +67,7 @@
|
||||
if (source) {
|
||||
if (message.content !== source.content || message.done !== source.done) {
|
||||
message = structuredClone(source);
|
||||
} else if (JSON.stringify(message) !== JSON.stringify(source)) {
|
||||
} else if (!equal(message, source)) {
|
||||
message = structuredClone(source);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user