Skip to content

Commit

Permalink
fix: Condition
Browse files Browse the repository at this point in the history
  • Loading branch information
bprusinowski committed Dec 16, 2024
1 parent dac1c16 commit 57712ab
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions app/components/chart-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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, { editable?: boolean }>((theme) => ({
Expand Down Expand Up @@ -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<HTMLDivElement, unknown>(`.${TEXT_BLOCK_WRAPPER_CLASS}`).each(
function () {
const wrapperEl = this;
Expand Down

0 comments on commit 57712ab

Please sign in to comment.