diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2019-11-04 20:44:01 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2019-11-04 20:44:01 +0900 |
| commit | cc7fec4b9fa92afc8e9253d01c64107a114c3fa7 (patch) | |
| tree | a9971df7a413116d81067db325abefcc51a553d1 /src/client/app/common/scripts | |
| parent | Update README.md [AUTOGEN] (#5574) (diff) | |
| download | sharkey-cc7fec4b9fa92afc8e9253d01c64107a114c3fa7.tar.gz sharkey-cc7fec4b9fa92afc8e9253d01c64107a114c3fa7.tar.bz2 sharkey-cc7fec4b9fa92afc8e9253d01c64107a114c3fa7.zip | |
Improve reaction setting
Fix #5577
Diffstat (limited to 'src/client/app/common/scripts')
| -rw-r--r-- | src/client/app/common/scripts/note-mixin.ts | 13 |
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) { |