Files
twenty/front/src/modules/ui/data/data-table/hooks/useCloseCurrentTableCellInEditMode.ts
Lucas Bordeau 3f2e1b622e Feat/show page metadata (#2234)
* Fix view fetch bug

* Finished types

* Removed console.log

* Fixed todo

* Working Object Show Page

* Minor fixes

* Fix custom object requests pending (#2240)

* Fix custom object requests pending

* fix typo

* Fix various bugs

* Typo

* Fix

* Fix

* Fix

---------

Co-authored-by: Weiko <corentin@twenty.com>
2023-10-27 11:06:07 +02:00

19 lines
652 B
TypeScript

import { useRecoilCallback } from 'recoil';
import { currentTableCellInEditModePositionState } from '../states/currentTableCellInEditModePositionState';
import { isTableCellInEditModeFamilyState } from '../states/isTableCellInEditModeFamilyState';
export const useCloseCurrentTableCellInEditMode = () =>
useRecoilCallback(({ set, snapshot }) => {
return async () => {
const currentTableCellInEditModePosition = snapshot
.getLoadable(currentTableCellInEditModePositionState)
.valueOrThrow();
set(
isTableCellInEditModeFamilyState(currentTableCellInEditModePosition),
false,
);
};
}, []);