mirror of
https://github.com/AppFlowy-IO/AppFlowy
synced 2026-05-23 09:08:24 +00:00
fix: wrong grid row count (#2973)
This commit is contained in:
parent
d4a23657d7
commit
c12aa66b2a
3 changed files with 4 additions and 14 deletions
|
|
@ -40,7 +40,7 @@ export const Grid = ({ viewId }: { viewId: string }) => {
|
|||
<GridAddRow controller={controller} />
|
||||
</div>
|
||||
|
||||
<GridTableCount />
|
||||
<GridTableCount rows={rows} />
|
||||
</div>
|
||||
{showGridRow && boardRowInfo && (
|
||||
<EditRow
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
};
|
||||
};
|
||||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in a new issue