From 57712ab7cab433758a4d67818c60cf7fd9a402b6 Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Mon, 16 Dec 2024 16:38:03 +0100 Subject: [PATCH] fix: Condition --- app/components/chart-panel.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/app/components/chart-panel.tsx b/app/components/chart-panel.tsx index 5e09a8634..9aa712478 100644 --- a/app/components/chart-panel.tsx +++ b/app/components/chart-panel.tsx @@ -30,7 +30,6 @@ import { LayoutTextBlock, } from "@/configurator"; import { useConfiguratorState, useLocale } from "@/src"; -import { assert } from "@/utils/assert"; import useEvent from "@/utils/use-event"; const useStyles = makeStyles((theme) => ({ @@ -225,15 +224,14 @@ const useSyncTextBlockHeight = () => { useEffect(() => { // Only adjust the height when not in published mode. - if (!layouting) { + if ( + !layouting || + layout.type !== "dashboard" || + layout.layout !== "canvas" + ) { return; } - assert( - layout.type === "dashboard" && layout.layout === "canvas", - "useSyncTextBlockHeight can only be used with free canvas layout" - ); - selectAll(`.${TEXT_BLOCK_WRAPPER_CLASS}`).each( function () { const wrapperEl = this;