diff --git a/src/views/board/BoardView.vue b/src/views/board/BoardView.vue index b7d215e..711225c 100644 --- a/src/views/board/BoardView.vue +++ b/src/views/board/BoardView.vue @@ -473,25 +473,26 @@ password.value = ''; passwordCommentAlert.value = ''; //currentPasswordCommentId.value = null; + isPassword.value = false; // 상단 프로필 비밀번호 const targetComment = findCommentById(comment.commentId, comments.value); - if (!targetComment) { return; } const isMyComment = comment.authorId === currentUserId.value; const isAnonymous = comment.author === '익명'; - if (isMyComment) { if (targetComment.isEditTextarea) { // 수정창이 열려 있는 상태에서 다시 수정 버튼을 누르면 초기화 + targetComment.isEditTextarea = false; + currentPasswordCommentId.value = comment.commentId; } else { // 다른 모든 댓글의 수정창 닫기 closeAllEditTextareas(); - + currentPasswordCommentId.value = null; // 현재 댓글만 수정 모드 활성화 targetComment.isEditTextarea = true; } @@ -541,9 +542,6 @@ // 익명 댓글 비밀번호 창 토글 const toggleCommentPassword = (comment, button) => { - console.log('comment.commentId: ', comment.commentId); - console.log('currentPasswordCommentId.value: ', currentPasswordCommentId.value); - console.log('lastCommentClickedButton.value : ', lastCommentClickedButton.value); if (lastCommentClickedButton.value === button && currentPasswordCommentId.value === comment.commentId) { currentPasswordCommentId.value = null; // 비밀번호 창 닫기 password.value = '';