diff --git a/src/api/relationships.ts b/src/api/relationships.ts index b244438..2e94408 100644 --- a/src/api/relationships.ts +++ b/src/api/relationships.ts @@ -10,17 +10,22 @@ export interface Relationship { subscription_to: boolean, subscription_from: boolean, showing_reblogs: boolean, + showing_replies: boolean, } export async function follow( authToken: string, profileId: string, showReposts: boolean, + showReplies: boolean, ): Promise { const url = `${BACKEND_URL}/api/v1/accounts/${profileId}/follow` const response = await http(url, { method: "POST", - json: { reblogs: showReposts }, + json: { + reblogs: showReposts, + replies: showReplies, + }, authToken, }) const data = await response.json() diff --git a/src/views/Profile.vue b/src/views/Profile.vue index 90cd967..fe840a9 100644 --- a/src/views/Profile.vue +++ b/src/views/Profile.vue @@ -15,7 +15,7 @@ @@ -286,7 +292,21 @@ export default class ProfileView extends Vue { return (this.relationship.following || this.relationship.requested) && !this.relationship.showing_reblogs } - async follow(showReposts?: boolean) { + canHideReplies(): boolean { + if (!this.relationship) { + return false + } + return (this.relationship.following || this.relationship.requested) && this.relationship.showing_replies + } + + canShowReplies(): boolean { + if (!this.relationship) { + return false + } + return (this.relationship.following || this.relationship.requested) && !this.relationship.showing_replies + } + + async follow(showReposts?: boolean, showReplies?: boolean) { if (!this.store.currentUser || !this.profile || !this.relationship) { return } @@ -294,6 +314,7 @@ export default class ProfileView extends Vue { this.store.ensureAuthToken(), this.profile.id, showReposts ?? this.relationship.showing_reblogs, + showReplies ?? this.relationship.showing_replies, ) }