diff --git a/src/components/Composer/Composer.vue b/src/components/Composer/Composer.vue index 055f2d8c..a1ee329f 100644 --- a/src/components/Composer/Composer.vue +++ b/src/components/Composer/Composer.vue @@ -109,17 +109,6 @@
- -
@@ -172,10 +161,21 @@ export default { FocusOnCreate, }, mixins: [CurrentUserMixin], + props: { + /** @type {import('vue').PropType} */ + initialMention: { + type: Object, + default: null, + }, + defaultVisibility: { + type: String, + default: localStorage.getItem('social.lastPostType') || 'followers', + }, + }, data() { return { statusContent: '', - visibility: localStorage.getItem('social.lastPostType') || 'followers', + visibility: this.defaultVisibility, loading: false, /** @type {Object} */ attachments: {}, @@ -197,8 +197,13 @@ export default { + '' }, selectTemplate(item) { - return '' - + '@' + item.original.value + '' + return ` + + + + @${item.original.value} + + ` }, values: debounce(async (text, populate) => { if (text.length < 1) { @@ -281,6 +286,17 @@ export default { this.replyTo = data this.visibility = data.visibility }) + + if (this.initialMention !== null) { + this.$refs.composerInput.innerHTML = ` + + + + @${this.initialMention.acct} + +  ` + this.updateStatusContent() + } }, methods: { updateStatusContent() { @@ -402,7 +418,6 @@ export default { }, }, } -