* 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>
19 lines
652 B
TypeScript
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,
|
|
);
|
|
};
|
|
}, []);
|