mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
chore: update editing cell
This commit is contained in:
parent
5ddb5100ad
commit
bd8d816862
@ -78,6 +78,9 @@ export const EditRow = ({
|
||||
|
||||
const typeOptionController = new TypeOptionController(viewId, Some(currentField));
|
||||
await typeOptionController.switchToField(newType);
|
||||
|
||||
setEditingCell(new CellIdentifier(viewId, rowInfo.row.id, editingCell.fieldId, newType));
|
||||
|
||||
setShowChangeFieldTypePopup(false);
|
||||
};
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user