mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: wrong grid row count (#2973)
This commit is contained in:
parent
d4a23657d7
commit
c12aa66b2a
@ -40,7 +40,7 @@ export const Grid = ({ viewId }: { viewId: string }) => {
|
|||||||
<GridAddRow controller={controller} />
|
<GridAddRow controller={controller} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<GridTableCount />
|
<GridTableCount rows={rows} />
|
||||||
</div>
|
</div>
|
||||||
{showGridRow && boardRowInfo && (
|
{showGridRow && boardRowInfo && (
|
||||||
<EditRow
|
<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 = () => {
|
export const GridTableCount = ({ rows }: { rows: readonly RowInfo[] }) => {
|
||||||
const { count } = useGridTableCount();
|
const count = rows.length;
|
||||||
return (
|
return (
|
||||||
<span>
|
<span>
|
||||||
Count : <span className='font-semibold'>{count}</span>
|
Count : <span className='font-semibold'>{count}</span>
|
||||||
|
Loading…
Reference in New Issue
Block a user