refactor(client): Use v-model for note component, freeze object
Related: #6595
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<button
|
||||
class="hkzvhatu _button"
|
||||
:class="{ reacted: myReaction == reaction, canToggle }"
|
||||
:class="{ reacted: note.myReaction == reaction, canToggle }"
|
||||
@click="toggleReaction(reaction)"
|
||||
v-if="count > 0"
|
||||
@touchstart="onMouseover"
|
||||
@@ -11,7 +11,7 @@
|
||||
ref="reaction"
|
||||
v-particle="canToggle"
|
||||
>
|
||||
<x-reaction-icon :reaction="reaction" :custom-emojis="emojis" ref="icon"/>
|
||||
<x-reaction-icon :reaction="reaction" :custom-emojis="note.emojis" ref="icon"/>
|
||||
<span>{{ count }}</span>
|
||||
</button>
|
||||
</template>
|
||||
@@ -30,14 +30,6 @@ export default Vue.extend({
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
myReaction: {
|
||||
type: String,
|
||||
required: false,
|
||||
},
|
||||
emojis: {
|
||||
type: Array,
|
||||
required: true,
|
||||
},
|
||||
count: {
|
||||
type: Number,
|
||||
required: true,
|
||||
@@ -79,7 +71,7 @@ export default Vue.extend({
|
||||
toggleReaction() {
|
||||
if (!this.canToggle) return;
|
||||
|
||||
const oldReaction = this.myReaction;
|
||||
const oldReaction = this.note.myReaction;
|
||||
if (oldReaction) {
|
||||
this.$root.api('notes/reactions/delete', {
|
||||
noteId: this.note.id
|
||||
|
Reference in New Issue
Block a user