warning수정

This commit is contained in:
kimdaae328 2025-02-28 11:09:10 +09:00
parent 63f8f167eb
commit 4720e61958
3 changed files with 13 additions and 4 deletions

View File

@ -16,7 +16,7 @@
@updateReaction="handleUpdateReaction"
/>
<!-- 댓글 비밀번호 입력창 (익명일 경우) -->
<div v-if="isCommentPassword === comment.commentId && unknown" class="mt-3 w-25 ms-auto">
<div v-if="currentPasswordCommentId === comment.commentId && unknown" class="mt-3 w-25 ms-auto">
<div class="input-group">
<input
type="password"
@ -59,6 +59,7 @@
:isCommentProfile="true"
:isCommentAuthor="child.isCommentAuthor"
:isCommentPassword="isCommentPassword"
:currentPasswordCommentId="currentPasswordCommentId"
@editClick="handleReplyEditClick"
@deleteClick="$emit('deleteClick', child)"
@submitEdit="(comment, editedContent) => $emit('submitEdit', comment, editedContent)"
@ -111,6 +112,9 @@ const props = defineProps({
passwordCommentAlert: {
type: String,
default: ''
},
currentPasswordCommentId: {
type: Number
}
});

View File

@ -12,6 +12,7 @@
:isEditTextarea="comment.isEditTextarea"
:isCommentPassword="isCommentPassword"
:passwordCommentAlert="passwordCommentAlert || ''"
:currentPasswordCommentId="currentPasswordCommentId"
@editClick="handleEditClick"
@deleteClick="handleDeleteClick"
@submitPassword="submitPassword"
@ -53,6 +54,9 @@ const props = defineProps({
passwordCommentAlert: {
type: String,
default: ''
},
currentPasswordCommentId: {
type: Number
}
});

View File

@ -102,6 +102,7 @@
:isCommentPassword="isCommentPassword"
:isEditTextarea="isEditTextarea"
:passwordCommentAlert="passwordCommentAlert"
:currentPasswordCommentId="currentPasswordCommentId"
@editClick="editComment"
@deleteClick="deleteComment"
@updateReaction="handleCommentReaction"
@ -489,10 +490,10 @@ const deleteComment = async (comment) => {
//
const toggleCommentPassword = (comment, button) => {
console.log(comment.commentId)
if (lastCommentClickedButton.value === button && isCommentPassword.value === comment.commentId) {
isCommentPassword.value = false; //
if (lastCommentClickedButton.value === button && currentPasswordCommentId.value === comment.commentId) {
currentPasswordCommentId.value = null; //
} else {
isCommentPassword.value = comment.commentId; //
currentPasswordCommentId.value = comment.commentId; //
}
lastCommentClickedButton.value = button;