Skip to content

Commit 8b1959c

Browse files
authored
fix: #799 삭제 토스트 실행시점 변경 및 삭제 감지 로직 추가 (#800)
1 parent 184061e commit 8b1959c

File tree

1 file changed

+5
-1
lines changed
  • apps/web/src/app/desktop/component/retrospectCreate/QuestionEditSection

1 file changed

+5
-1
lines changed

apps/web/src/app/desktop/component/retrospectCreate/QuestionEditSection/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ export default function QuestionEditSection({ onClose }: QuestionEditSectionProp
9797
const handleDelete = (index: number) => {
9898
const updatedQuestions = questions.filter((_, i) => i !== index);
9999
setEditingQuestions(updatedQuestions);
100-
toast.success("삭제가 완료되었어요!");
101100
};
102101

103102
/**
@@ -212,8 +211,13 @@ export default function QuestionEditSection({ onClose }: QuestionEditSectionProp
212211
* 삭제 모드 완료 핸들러
213212
*/
214213
const handleDeleteModeComplete = () => {
214+
const hasDeleted = questions.length < backupQuestions.length;
215215
setIsDeleteMode(false);
216216
setBackupQuestions([]);
217+
218+
if (hasDeleted) {
219+
toast.success("삭제가 완료되었어요!");
220+
}
217221
};
218222

219223
// 제출 완료 핸들러

0 commit comments

Comments
 (0)