Add Atom feed link to profile menu

This commit is contained in:
silverpill 2022-04-14 23:16:51 +00:00
parent 85cd892827
commit 609d7b0ae8

View file

@ -15,7 +15,6 @@
</div>
</div>
<div
v-if="!isLocalUser() || canConnectWallet() || canConfigureSubscription() || canSubscribe() || canHideReposts() || canShowReposts() || canHideReplies() || canShowReplies()"
class="dropdown-menu-wrapper"
v-click-away="hideProfileMenu"
>
@ -33,6 +32,14 @@
>
Open profile page
</a>
</li>
<li v-if="isLocalUser()">
<a
:href="feedUrl"
target="_blank"
>
Atom feed
</a>
</li>
<li v-if="canConnectWallet()">
<a
@ -160,6 +167,7 @@ import Avatar from "@/components/Avatar.vue"
import PostList from "@/components/PostList.vue"
import ProfileListItem from "@/components/ProfileListItem.vue"
import Sidebar from "@/components/Sidebar.vue"
import { BACKEND_URL } from "@/constants"
import { useInstanceInfo } from "@/store/instance"
import { useCurrentUser } from "@/store/user"
import { getWallet } from "@/utils/ethereum"
@ -343,6 +351,13 @@ export default class ProfileView extends Vue {
return this.profile.username === this.profile.acct
}
get feedUrl(): string {
if (!this.profile || !this.isLocalUser()) {
return ""
}
return `${BACKEND_URL}/feeds/${this.profile.username}`
}
canConnectWallet(): boolean {
return Boolean(this.store.instance?.blockchain_contract_address) && !this.walletConnected
}