Skip to content

Commit

Permalink
chore(comments): register Pinia and clean up
Browse files Browse the repository at this point in the history
Signed-off-by: Grigory Vodyanov <scratchx@gmx.com>
  • Loading branch information
GVodyanov authored and GretaD committed Jul 1, 2024
1 parent 1c90a43 commit 68ba038
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
2 changes: 0 additions & 2 deletions apps/comments/src/components/Comment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,6 @@ export default {
},

isLimbo() {
console.log('checking for limbo', this.id)

return this.deletedCommentLimboStore.checkForId(this.id)
},
},
Expand Down
2 changes: 0 additions & 2 deletions apps/comments/src/mixins/CommentMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ export default {

// DELETION
onDeleteWithUndo() {
console.log('DELETE WITH UNDO')
this.$emit('delete')
this.deleted = true
this.deletedCommentLimboStore.addId(this.id)
const timeOutDelete = setTimeout(this.onDelete, TOAST_UNDO_TIMEOUT)
Expand Down
4 changes: 1 addition & 3 deletions apps/comments/src/store/deletedCommentLimbo.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,18 @@ export const useDeletedCommentLimbo = defineStore('deletedCommentLimbo', {
}),
actions: {
addId(id) {
console.log('ADDING ID TO LIMBO', id, this.idsInLimbo)
this.idsInLimbo.push(id)
},

removeId(id) {
console.log('REMOVING ID FROM LIMBO', id, this.idsInLimbo)
const index = this.idsInLimbo.indexOf(id)
if (index > -1) {
this.idsInLimbo.splice(index, 1)
}
},

checkForId(id) {
this.idsInLimbo.includes(id)
return this.idsInLimbo.includes(id)
}
},
})

0 comments on commit 68ba038

Please sign in to comment.