File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111 </span >
1212 </div >
1313
14- <CommentItem v-if =" replyTo "
15- :comment =" replyTo "
14+ <CommentItem v-if =" commentStore . replyTo "
15+ :comment =" commentStore . replyTo "
1616 :reply =" true "
1717 :preview =" true "
1818 @cancel =" cancelReply " />
1919 <CommentForm v-model =" newComment " @submit =" createComment " />
2020
21- <ul v-if =" getCommentsForCard(card.id).length > 0" id =" commentsFeed" >
22- <CommentItem v-for =" comment in getCommentsForCard (card .id )"
21+ <ul v-if =" commentStore. getCommentsForCard(card.id).length > 0" id =" commentsFeed" >
22+ <CommentItem v-for =" comment in commentStore . getCommentsForCard (card .id )"
2323 :key =" comment .id "
2424 :comment =" comment "
2525 @doReload =" loadComments " />
@@ -81,15 +81,6 @@ export default {
8181 ... mapState ({
8282 currentBoard : state => state .currentBoard ,
8383 }),
84- replyTo () {
85- return this .commentStore .replyTo
86- },
87- getCommentsForCard () {
88- return this .commentStore .getCommentsForCard
89- },
90- hasMoreComments () {
91- return this .commentStore .hasMoreComments
92- },
9384 members () {
9485 return this .currentBoard .users
9586 },
@@ -107,7 +98,7 @@ export default {
10798 this .error = null
10899 try {
109100 await this .loadMore ()
110- if (this .hasMoreComments (this .card .id )) {
101+ if (this .commentStore . hasMoreComments (this .card .id )) {
111102 $state .loaded ()
112103 } else {
113104 $state .complete ()
Original file line number Diff line number Diff line change @@ -48,9 +48,9 @@ export const useCommentStore = defineStore('comment', {
4848 } ,
4949 async updateComment ( { cardId, comment } ) {
5050 const updatedComment = await apiClient . updateComment ( { cardId, id : comment . id , comment : comment . message } )
51- const existingIndex = this . comments [ cardId ] . comments . findIndex ( c => c . id === comment . id )
51+ const existingIndex = this . comments [ cardId ] . comments . findIndex ( c => c . id === updatedComment . id )
5252 if ( existingIndex !== - 1 ) {
53- Object . assign ( this . comments [ cardId ] . comments [ existingIndex ] , comment )
53+ Object . assign ( this . comments [ cardId ] . comments [ existingIndex ] , updatedComment )
5454 }
5555 } ,
5656 async deleteComment ( comment ) {
You can’t perform that action at this time.
0 commit comments