fix: chart resize wizard closed

This commit is contained in:
Arman
2023-02-10 13:55:24 +01:00
parent fa5dff36b8
commit 156e0522c7
+6 -1
View File
@@ -9,6 +9,7 @@
import type { ECharts } from 'echarts/core';
import type { BarSeriesOption, LineSeriesOption } from 'echarts/charts';
import type { EChartsOption } from 'echarts';
import { wizard } from '$lib/stores/wizard';
registerTheme('light', { ...base, ...light });
registerTheme('dark', { ...base, ...dark });
@@ -70,7 +71,7 @@
let timeoutId: unknown;
const onResize = () => {
if (timeoutId == undefined) {
if (timeoutId == undefined && !$wizard.show) {
timeoutId = setTimeout(() => {
if (chart && !chart.isDisposed()) {
chart.resize();
@@ -79,6 +80,10 @@
}, 250);
}
};
$: if (!$wizard.show) {
onResize();
}
</script>
<svelte:window on:resize={onResize} />