From cc7fec4b9fa92afc8e9253d01c64107a114c3fa7 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 4 Nov 2019 20:44:01 +0900 Subject: Improve reaction setting Fix #5577 --- src/client/app/common/scripts/note-mixin.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/client/app/common/scripts/note-mixin.ts') 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) { -- cgit v1.2.3-freya