fix: stop state_snapshot_uncloneable warnings from chart options (#12653)

* fix: stop state_snapshot_uncloneable warnings from chart options

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor: reuse clone() from $lib/utils for chart options

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Guilhem
2026-11-25 22:31:02 +01:00
committed by GitHub
co-authored by Claude Opus 5.5
parent 8e3f11705f
commit 2bdad42ad0
@@ -8,6 +8,7 @@
import 'chart.js/auto'
import 'chartjs-adapter-date-fns'
import { untrack } from 'svelte'
import { clone } from '$lib/utils'
interface Props extends HTMLCanvasAttributes {
type: T
@@ -28,7 +29,7 @@
chart = new Chart(canvasElem, {
type,
data: $state.snapshot(data) as typeof data,
options: $state.snapshot(options) as typeof options
options: clone(options)
})
})
return () => {