summaryrefslogtreecommitdiff
path: root/src/client/app/common/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/app/common/scripts')
-rw-r--r--src/client/app/common/scripts/note-mixin.ts13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/client/app/common/scripts/note-mixin.ts b/src/client/app/common/scripts/note-mixin.ts
index 43fb4fd51e..84e134cc32 100644
--- a/src/client/app/common/scripts/note-mixin.ts
+++ b/src/client/app/common/scripts/note-mixin.ts
@@ -145,13 +145,18 @@ export default (opts: Opts = {}) => ({
this.blur();
const w = this.$root.new(MkReactionPicker, {
source: this.$refs.reactButton,
- note: this.appearNote,
showFocus: viaKeyboard,
animation: !viaKeyboard
- }).$once('closed', this.focus);
- this.$once('hook:beforeDestroy', () => {
- w.close();
});
+ w.$once('chosen', reaction => {
+ this.$root.api('notes/reactions/create', {
+ noteId: this.appearNote.id,
+ reaction: reaction
+ }).then(() => {
+ w.close();
+ });
+ });
+ w.$once('closed', this.focus);
},
reactDirectly(reaction) {