リモートアカウントの投稿に対しての返信にはメンションを付けるように

This commit is contained in:
syuilo 2018-05-07 16:25:06 +09:00
parent 4955df3911
commit de6cbf8a22
2 changed files with 16 additions and 14 deletions

View file

@ -105,21 +105,11 @@ export default Vue.extend({
} }
}, },
watch: {
text() {
this.saveDraft();
},
poll() {
this.saveDraft();
},
files() {
this.saveDraft();
}
},
mounted() { mounted() {
if (this.reply && this.reply.user.host != null) {
this.text = `@${this.reply.user.username}@${this.reply.user.host} `;
}
this.$nextTick(() => { this.$nextTick(() => {
// 稿 // 稿
const draft = JSON.parse(localStorage.getItem('drafts') || '{}')[this.draftId]; const draft = JSON.parse(localStorage.getItem('drafts') || '{}')[this.draftId];
@ -134,10 +124,18 @@ export default Vue.extend({
} }
this.$emit('change-attached-media', this.files); this.$emit('change-attached-media', this.files);
} }
this.$nextTick(() => this.watch());
}); });
}, },
methods: { methods: {
watch() {
this.$watch('text', () => this.saveDraft());
this.$watch('poll', () => this.saveDraft());
this.$watch('files', () => this.saveDraft());
},
focus() { focus() {
(this.$refs.text as any).focus(); (this.$refs.text as any).focus();
}, },

View file

@ -67,6 +67,10 @@ export default Vue.extend({
}, },
mounted() { mounted() {
if (this.reply && this.reply.user.host != null) {
this.text = `@${this.reply.user.username}@${this.reply.user.host} `;
}
this.$nextTick(() => { this.$nextTick(() => {
this.focus(); this.focus();
}); });