수정 토글 닫기도 되게 수정

This commit is contained in:
nevermoregb 2025-03-11 13:33:06 +09:00
parent 003e9da85e
commit ef1101d9ee

View File

@ -472,7 +472,7 @@
const editComment = comment => { const editComment = comment => {
password.value = ''; password.value = '';
passwordCommentAlert.value = ''; passwordCommentAlert.value = '';
currentPasswordCommentId.value = null; //currentPasswordCommentId.value = null;
const targetComment = findCommentById(comment.commentId, comments.value); const targetComment = findCommentById(comment.commentId, comments.value);
@ -498,6 +498,7 @@
} else if (isAnonymous) { } else if (isAnonymous) {
if (currentPasswordCommentId.value === comment.commentId) { if (currentPasswordCommentId.value === comment.commentId) {
// //
toggleCommentPassword(comment, 'edit');
return; return;
} else { } else {
// //
@ -540,6 +541,9 @@
// //
const toggleCommentPassword = (comment, button) => { 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) { if (lastCommentClickedButton.value === button && currentPasswordCommentId.value === comment.commentId) {
currentPasswordCommentId.value = null; // currentPasswordCommentId.value = null; //
password.value = ''; password.value = '';