|
@@ -5,10 +5,12 @@ import { CellIdentifier } from '$app/stores/effects/database/cell/cell_bd_svc';
|
|
|
import { useEffect, useState } from 'react';
|
|
|
import { TypeOptionController } from '$app/stores/effects/database/field/type_option/type_option_controller';
|
|
|
import { None } from 'ts-results';
|
|
|
+import { useAppSelector } from '$app/stores/store';
|
|
|
|
|
|
export const useRow = (viewId: string, databaseController: DatabaseController, rowInfo: RowInfo) => {
|
|
|
const [cells, setCells] = useState<{ fieldId: string; cellIdentifier: CellIdentifier }[]>([]);
|
|
|
const [rowController, setRowController] = useState<RowController>();
|
|
|
+ const databaseStore = useAppSelector((state) => state.database);
|
|
|
|
|
|
useEffect(() => {
|
|
|
if (!databaseController || !rowInfo) return;
|
|
@@ -38,7 +40,7 @@ export const useRow = (viewId: string, databaseController: DatabaseController, r
|
|
|
|
|
|
setCells(loadingCells);
|
|
|
})();
|
|
|
- }, [rowController]);
|
|
|
+ }, [rowController, databaseStore.columns]);
|
|
|
|
|
|
const onNewColumnClick = async () => {
|
|
|
if (!databaseController) return;
|