Update ContextMenu, add View Profile link

This commit is contained in:
Daniel Supernault 2021-07-15 23:18:40 -06:00
parent ca6e491c83
commit 8544bcbda6
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -12,6 +12,7 @@
<!-- <div v-if="status && status.account.id != profile.id && ctxMenuRelationship && ctxMenuRelationship.following" class="list-group-item rounded cursor-pointer font-weight-bold text-danger" @click="ctxMenuUnfollow()">Unfollow</div>
<div v-if="status && status.account.id != profile.id && ctxMenuRelationship && !ctxMenuRelationship.following" class="list-group-item rounded cursor-pointer font-weight-bold text-primary" @click="ctxMenuFollow()">Follow</div> -->
<div class="list-group-item rounded cursor-pointer" @click="ctxMenuGoToPost()">View Post</div>
<div class="list-group-item rounded cursor-pointer" @click="ctxMenuGoToProfile()">View Profile</div>
<!-- <div v-if="status && status.local == true && !status.in_reply_to_id" class="list-group-item rounded cursor-pointer" @click="ctxMenuEmbed()">Embed</div>
<div class="list-group-item rounded cursor-pointer" @click="ctxMenuCopyLink()">Copy Link</div> -->
<div class="list-group-item rounded cursor-pointer" @click="ctxMenuShare()">Share</div>
@ -279,6 +280,13 @@
return;
},
ctxMenuGoToProfile() {
let status = this.ctxMenuStatus;
window.location.href = this.profileUrl(status);
this.closeCtxMenu();
return;
},
ctxMenuFollow() {
let id = this.ctxMenuStatus.account.id;
axios.post('/i/follow', {
@ -633,6 +641,14 @@
return '/i/web/post/_/' + status.account.id + '/' + status.id;
},
profileUrl(status) {
if(status.local == true) {
return status.account.url;
}
return '/i/web/profile/_/' + status.account.id;
},
deletePost(status) {
if($('body').hasClass('loggedIn') == false || this.ownerOrAdmin(status) == false) {
return;