From c12aa66b2a710c68cf356d1efd45762cd838b832 Mon Sep 17 00:00:00 2001 From: Daiki Nakashita Date: Thu, 13 Jul 2023 12:01:22 +0900 Subject: [PATCH] fix: wrong grid row count (#2973) --- .../src/appflowy_app/components/grid/Grid/Grid.tsx | 2 +- .../grid/GridTableCount/GridTableCount.hooks.ts | 10 ---------- .../components/grid/GridTableCount/GridTableCount.tsx | 6 +++--- 3 files changed, 4 insertions(+), 14 deletions(-) delete mode 100644 frontend/appflowy_tauri/src/appflowy_app/components/grid/GridTableCount/GridTableCount.hooks.ts diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/grid/Grid/Grid.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/grid/Grid/Grid.tsx index 69bd3e7a0e..3c85c40a71 100644 --- a/frontend/appflowy_tauri/src/appflowy_app/components/grid/Grid/Grid.tsx +++ b/frontend/appflowy_tauri/src/appflowy_app/components/grid/Grid/Grid.tsx @@ -40,7 +40,7 @@ export const Grid = ({ viewId }: { viewId: string }) => { - + {showGridRow && boardRowInfo && ( { - const { grid } = useAppSelector((state) => state); - const { rows } = grid; - - return { - count: rows.length, - }; -}; diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/grid/GridTableCount/GridTableCount.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/grid/GridTableCount/GridTableCount.tsx index f067a0bad9..727f831a81 100644 --- a/frontend/appflowy_tauri/src/appflowy_app/components/grid/GridTableCount/GridTableCount.tsx +++ b/frontend/appflowy_tauri/src/appflowy_app/components/grid/GridTableCount/GridTableCount.tsx @@ -1,7 +1,7 @@ -import { useGridTableCount } from './GridTableCount.hooks'; +import { RowInfo } from '@/appflowy_app/stores/effects/database/row/row_cache'; -export const GridTableCount = () => { - const { count } = useGridTableCount(); +export const GridTableCount = ({ rows }: { rows: readonly RowInfo[] }) => { + const count = rows.length; return ( Count : {count}