Show subscription page only if profile is local

This commit is contained in:
silverpill 2022-07-16 16:00:54 +00:00
parent cb35d88d77
commit e1e4ae4333
2 changed files with 9 additions and 1 deletions

View file

@ -436,6 +436,7 @@ export default class ProfileView extends Vue {
Boolean(this.store.instance?.blockchain_features?.subscription) &&
this.profile !== null &&
getVerifiedEthereumAddress(this.profile) !== null &&
this.isLocalUser() &&
!this.isCurrentUser()
)
}

View file

@ -1,5 +1,5 @@
<template>
<div id="main" v-if="profile">
<div id="main" v-if="profile && isLocalUser()">
<div class="content">
<component
:is="isCurrentUser() ? SubscriptionSetup : Subscription"
@ -32,6 +32,13 @@ onMounted(async () => {
)
})
function isLocalUser(): boolean {
if (!profile) {
return false
}
return profile.username === profile.acct
}
function isCurrentUser(): boolean {
if (!currentUser || !profile) {
return false