Improve reaction setting

Fix #5577
This commit is contained in:
syuilo
2019-11-04 20:44:01 +09:00
parent 88ec15d4c7
commit cc7fec4b9f
4 changed files with 32 additions and 26 deletions

View File

@ -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) {