fix: wrong grid row count (#2973)

This commit is contained in:
Daiki Nakashita 2023-07-13 12:01:22 +09:00 committed by GitHub
parent d4a23657d7
commit c12aa66b2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 14 deletions

View File

@ -40,7 +40,7 @@ export const Grid = ({ viewId }: { viewId: string }) => {
<GridAddRow controller={controller} />
</div>
<GridTableCount />
<GridTableCount rows={rows} />
</div>
{showGridRow && boardRowInfo && (
<EditRow

View File

@ -1,10 +0,0 @@
import { useAppSelector } from '$app/stores/store';
export const useGridTableCount = () => {
const { grid } = useAppSelector((state) => state);
const { rows } = grid;
return {
count: rows.length,
};
};

View File

@ -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 (
<span>
Count : <span className='font-semibold'>{count}</span>