Preserve visibility settings when replying to post
This commit is contained in:
parent
f9f2e40ad0
commit
89cdcba68b
2 changed files with 10 additions and 4 deletions
|
@ -166,7 +166,7 @@
|
|||
</div>
|
||||
<post-editor
|
||||
v-if="commentFormVisible"
|
||||
:in-reply-to="post.id"
|
||||
:in-reply-to="post"
|
||||
@post-created="onCommentCreated"
|
||||
>
|
||||
</post-editor>
|
||||
|
|
|
@ -88,7 +88,7 @@
|
|||
import { Options, Vue, setup } from "vue-class-component"
|
||||
import { Prop } from "vue-property-decorator"
|
||||
|
||||
import { createPost, Attachment, uploadAttachment } from "@/api/posts"
|
||||
import { Post, createPost, Attachment, uploadAttachment } from "@/api/posts"
|
||||
import { User } from "@/api/users"
|
||||
import Avatar from "@/components/Avatar.vue"
|
||||
import VisibilityIcon from "@/components/VisibilityIcon.vue"
|
||||
|
@ -108,7 +108,7 @@ const POST_CHARACTER_LIMIT = 1000
|
|||
export default class PostEditor extends Vue {
|
||||
|
||||
@Prop()
|
||||
inReplyTo: string | null = null
|
||||
inReplyTo: Post | null = null
|
||||
|
||||
content = ""
|
||||
visibility = "public"
|
||||
|
@ -131,6 +131,12 @@ export default class PostEditor extends Vue {
|
|||
return this.store.currentUser
|
||||
}
|
||||
|
||||
created() {
|
||||
if (this.inReplyTo) {
|
||||
this.visibility = this.inReplyTo.visibility
|
||||
}
|
||||
}
|
||||
|
||||
mounted() {
|
||||
setupAutoResize(this.$refs.postFormContent)
|
||||
}
|
||||
|
@ -164,7 +170,7 @@ export default class PostEditor extends Vue {
|
|||
const content = renderMarkdownLite(this.content)
|
||||
const postData = {
|
||||
content,
|
||||
in_reply_to_id: this.inReplyTo,
|
||||
in_reply_to_id: this.inReplyTo ? this.inReplyTo.id : null,
|
||||
visibility: this.visibility,
|
||||
}
|
||||
let post
|
||||
|
|
Loading…
Reference in a new issue