Fix comments URLs
Also remote comments were marked as local Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
131730ce5e
commit
b911ecbb00
|
@ -13,11 +13,11 @@
|
||||||
<strong>{{ comment.actor.name }}</strong>
|
<strong>{{ comment.actor.name }}</strong>
|
||||||
<small v-if="comment.actor.domain">@{{ comment.actor.preferredUsername }}@{{ comment.actor.domain }}</small>
|
<small v-if="comment.actor.domain">@{{ comment.actor.preferredUsername }}@{{ comment.actor.domain }}</small>
|
||||||
<small v-else>@{{ comment.actor.preferredUsername }}</small>
|
<small v-else>@{{ comment.actor.preferredUsername }}</small>
|
||||||
<a class="comment-link has-text-grey" :href="commentId">
|
<a class="comment-link has-text-grey" :href="commentURL">
|
||||||
<small>{{ timeago(new Date(comment.updatedAt)) }}</small>
|
<small>{{ timeago(new Date(comment.updatedAt)) }}</small>
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
<a v-else class="comment-link has-text-grey" :href="commentId">
|
<a v-else class="comment-link has-text-grey" :href="commentURL">
|
||||||
<span>{{ $t('[deleted]') }}</span>
|
<span>{{ $t('[deleted]') }}</span>
|
||||||
</a>
|
</a>
|
||||||
<span class="icons" v-if="!comment.deletedAt">
|
<span class="icons" v-if="!comment.deletedAt">
|
||||||
|
@ -222,6 +222,11 @@ export default class Comment extends Vue {
|
||||||
return `#comment-${this.comment.uuid}`;
|
return `#comment-${this.comment.uuid}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get commentURL(): String {
|
||||||
|
if (!this.comment.local && this.comment.url) return this.comment.url;
|
||||||
|
return this.commentId;
|
||||||
|
}
|
||||||
|
|
||||||
reportModal() {
|
reportModal() {
|
||||||
this.$buefy.modal.open({
|
this.$buefy.modal.open({
|
||||||
parent: this,
|
parent: this,
|
||||||
|
|
|
@ -8,6 +8,7 @@ export const COMMENT_FIELDS_FRAGMENT = gql`
|
||||||
url,
|
url,
|
||||||
text,
|
text,
|
||||||
visibility,
|
visibility,
|
||||||
|
local,
|
||||||
actor {
|
actor {
|
||||||
avatar {
|
avatar {
|
||||||
url
|
url
|
||||||
|
|
|
@ -6,6 +6,7 @@ export interface IComment {
|
||||||
uuid?: string;
|
uuid?: string;
|
||||||
url?: string;
|
url?: string;
|
||||||
text: string;
|
text: string;
|
||||||
|
local: boolean;
|
||||||
actor: IActor;
|
actor: IActor;
|
||||||
inReplyToComment?: IComment;
|
inReplyToComment?: IComment;
|
||||||
originComment?: IComment;
|
originComment?: IComment;
|
||||||
|
@ -20,6 +21,7 @@ export class CommentModel implements IComment {
|
||||||
actor: IActor = new Actor();
|
actor: IActor = new Actor();
|
||||||
id?: string;
|
id?: string;
|
||||||
text: string = '';
|
text: string = '';
|
||||||
|
local: boolean = true;
|
||||||
url?: string;
|
url?: string;
|
||||||
uuid?: string;
|
uuid?: string;
|
||||||
inReplyToComment?: IComment = undefined;
|
inReplyToComment?: IComment = undefined;
|
||||||
|
|
|
@ -39,7 +39,8 @@ defmodule Mobilizon.Events.Comment do
|
||||||
:in_reply_to_comment_id,
|
:in_reply_to_comment_id,
|
||||||
:origin_comment_id,
|
:origin_comment_id,
|
||||||
:attributed_to_id,
|
:attributed_to_id,
|
||||||
:deleted_at
|
:deleted_at,
|
||||||
|
:local
|
||||||
]
|
]
|
||||||
@attrs @required_attrs ++ @optional_attrs
|
@attrs @required_attrs ++ @optional_attrs
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue