Skip to content

Commit

Permalink
Merge pull request #283 from appwrite/fix-chart-resize-wizard-closed
Browse files Browse the repository at this point in the history
fix: chart resize wizard closed
  • Loading branch information
TorstenDittmann committed Feb 10, 2023
2 parents fa5dff3 + 156e052 commit 3c84356
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lib/charts/base.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down Expand Up @@ -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();
Expand All @@ -79,6 +80,10 @@
}, 250);
}
};
$: if (!$wizard.show) {
onResize();
}
</script>

<svelte:window on:resize={onResize} />
Expand Down

1 comment on commit 3c84356

@vercel
Copy link

@vercel vercel bot commented on 3c84356 Feb 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.