Skip to content

Commit 24806ed

Browse files
committed
[#153] feat: Socket 구현사항을 BlockContent에 반영
1 parent 7a7e444 commit 24806ed

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

frontend/src/components/atoms/BlockContent/BlockContent.tsx

+3-10
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,9 @@ function BlockContent(blockDTO: Block) {
7070
const focusId = useRecoilValue(focusState);
7171
const listCnt = useRef(1);
7272
const [Dispatcher] = useCommand();
73-
const [
74-
{ blockIndex, prevSiblings },
75-
{ commitTransaction, startTransaction, setBlock, deleteBlock },
76-
] = useManager(blockDTO.id);
73+
const [{ blockIndex, prevSiblings }, { setBlock, deleteBlock }] = useManager(
74+
blockDTO.id,
75+
);
7776
const [draggingBlock, setDraggingBlock] = useRecoilState(draggingBlockState);
7877
const [dragOverToggle, setDragOverToggle] = useState(false);
7978

@@ -115,9 +114,7 @@ function BlockContent(blockDTO: Block) {
115114
type?: BlockType,
116115
caretOffset = -1,
117116
) => {
118-
startTransaction();
119117
await setBlock(blockDTO.id, { value, type: type || blockDTO.type });
120-
commitTransaction();
121118
};
122119

123120
const handleValue = async () => {
@@ -220,9 +217,7 @@ function BlockContent(blockDTO: Block) {
220217
!blockDTO.childIdList.length
221218
) {
222219
setImmediate(async () => {
223-
startTransaction();
224220
await deleteBlock();
225-
commitTransaction();
226221
});
227222
}
228223

@@ -271,11 +266,9 @@ function BlockContent(blockDTO: Block) {
271266
toId: blockDTO.parentId,
272267
index: blockIndex + 1,
273268
});
274-
startTransaction();
275269
await setBlock(block.id, block);
276270
fromBlock && (await setBlock(fromBlock.id, fromBlock));
277271
await setBlock(to.id, to);
278-
commitTransaction();
279272
setDraggingBlock(null);
280273
event.preventDefault();
281274
};

0 commit comments

Comments
 (0)