diff --git a/src/nodes/NoteFlow.tsx b/src/nodes/NoteFlow.tsx index b181b92..fb2bd16 100644 --- a/src/nodes/NoteFlow.tsx +++ b/src/nodes/NoteFlow.tsx @@ -132,6 +132,12 @@ const NoteFlow = () => { const handleTabClick = (option) => { setShowTabBar(false); + + if (selectedNodeId === option.id) { + alert('Node này đã được thêm. Vui lòng chọn một node khác.'); + return; + } + const newNode = { id: option.id, data: { label: option.html }, @@ -250,6 +256,7 @@ const NoteFlow = () => { setShowPopup(false); } + return (
@@ -272,6 +279,7 @@ const NoteFlow = () => {
handleTabClick(option)} + style={{ padding: '10px', cursor: selectedNodeId === option.id ? 'not-allowed' : 'pointer',