From 18c0da7d4dc8ffa8e11708f0fd529ab0271715b5 Mon Sep 17 00:00:00 2001 From: Meghea Iulian Date: Wed, 19 Jun 2024 18:26:58 +0300 Subject: [PATCH] fix(mini): check for null and undefined mini attribute check for null and undefined mini attribute when checking if a column is enabled in mini mode. --- lib/use-mini.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/use-mini.js b/lib/use-mini.js index f4b159e9..cc2e64f4 100644 --- a/lib/use-mini.js +++ b/lib/use-mini.js @@ -10,11 +10,12 @@ export const useMini = ({ host, canvasWidth, columns: _columns }) => { () => isMiniSize ? _columns - ?.filter((c) => c.mini !== null) + ?.filter((c) => c.mini != null) .sort((a, b) => (a.mini ?? 0) - (b.mini ?? 0)) : [], [_columns, isMiniSize], ); + const [miniColumn, ...miniColumns] = columns ?? []; useEffect(() => {