익명일때 수정,삭제 비밀번호 폼 한번 더 클릭시 폼 닫히게

This commit is contained in:
nevermoregb 2025-03-11 13:59:21 +09:00
parent ef1101d9ee
commit 538413c963

View File

@ -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 = '';