Skip to content

Commit 6fc35c1

Browse files
committed
fix: #799 삭제 토스트 실행시점 변경 및 삭제 감지 로직 추가
1 parent 5f24819 commit 6fc35c1

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
@@ -95,7 +95,6 @@ export default function QuestionEditSection({ onClose }: QuestionEditSectionProp
9595
const handleDelete = (index: number) => {
9696
const updatedQuestions = questions.filter((_, i) => i !== index);
9797
setEditingQuestions(updatedQuestions);
98-
toast.success("삭제가 완료되었어요!");
9998
};
10099

101100
/**
@@ -221,8 +220,13 @@ export default function QuestionEditSection({ onClose }: QuestionEditSectionProp
221220
* 삭제 모드 완료 핸들러
222221
*/
223222
const handleDeleteModeComplete = () => {
223+
const hasDeleted = questions.length < backupQuestions.length;
224224
setIsDeleteMode(false);
225225
setBackupQuestions([]);
226+
227+
if (hasDeleted) {
228+
toast.success("삭제가 완료되었어요!");
229+
}
226230
};
227231

228232
// 제출 완료 핸들러

0 commit comments

Comments
 (0)