1
0
Fork 0
forked from mirror/pixelfed

Update ComposeModal, limit visibility scope for private accounts

This commit is contained in:
Daniel Supernault 2021-02-28 22:35:43 -07:00
parent 77d4353a0a
commit 001d410579
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -479,9 +479,26 @@
<div v-if="page == 'visibility'" class="w-100 h-100"> <div v-if="page == 'visibility'" class="w-100 h-100">
<div class="list-group list-group-flush"> <div class="list-group list-group-flush">
<div :class="'list-group-item lead cursor-pointer ' + [visibility == 'public'?'text-primary':'']" @click="toggleVisibility('public')">Public</div> <div
<div :class="'list-group-item lead cursor-pointer ' + [visibility == 'unlisted'?'text-primary':'']" @click="toggleVisibility('unlisted')">Unlisted</div> v-if="!profile.locked"
<div :class="'list-group-item lead cursor-pointer ' + [visibility == 'private'?'text-primary':'']" @click="toggleVisibility('private')">Followers Only</div> class="list-group-item lead cursor-pointer"
:class="{ 'text-primary': visibility == 'public' }"
@click="toggleVisibility('public')">
Public
</div>
<div
v-if="!profile.locked"
class="list-group-item lead cursor-pointer"
:class="{ 'text-primary': visibility == 'unlisted' }"
@click="toggleVisibility('unlisted')">
Unlisted
</div>
<div
class="list-group-item lead cursor-pointer"
:class="{ 'text-primary': visibility == 'private' }"
@click="toggleVisibility('private')">
Followers Only
</div>
</div> </div>
</div> </div>
@ -641,7 +658,7 @@ export default {
return { return {
config: window.App.config, config: window.App.config,
pageLoading: false, pageLoading: false,
profile: {}, profile: window._sharedData.curUser,
composeText: '', composeText: '',
composeTextLength: 0, composeTextLength: 0,
nsfw: false, nsfw: false,
@ -708,20 +725,19 @@ export default {
methods: { methods: {
fetchProfile() { fetchProfile() {
let self = this; if(window._sharedData.curUser.id) {
if(window._sharedData.curUser) { this.profile = window._sharedData.curUser;
self.profile = window._sharedData.curUser; if(this.profile.locked == true) {
if(self.profile.locked == true) { this.visibility = 'private';
self.visibility = 'private'; this.visibilityTag = 'Followers Only';
self.visibilityTag = 'Followers Only';
} }
} else { } else {
axios.get('/api/pixelfed/v1/accounts/verify_credentials').then(res => { axios.get('/api/pixelfed/v1/accounts/verify_credentials').then(res => {
self.profile = res.data; window._sharedData.currentUser = res.data;
window.pixelfed.currentUser = res.data; this.profile = res.data;
if(res.data.locked == true) { if(this.profile.locked == true) {
self.visibility = 'private'; this.visibility = 'private';
self.visibilityTag = 'Followers Only'; this.visibilityTag = 'Followers Only';
} }
}).catch(err => { }).catch(err => {
}); });