Update ComposeModal.vue component, reuse sharedData

This commit is contained in:
Daniel Supernault 2020-12-05 00:24:26 -07:00
parent f1ab44686b
commit e28d022f62
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -635,15 +635,23 @@ export default {
methods: { methods: {
fetchProfile() { fetchProfile() {
let self = this; let self = this;
axios.get('/api/pixelfed/v1/accounts/verify_credentials').then(res => { if(window._sharedData.curUser) {
self.profile = res.data; self.profile = window._sharedData.curUser;
window.pixelfed.currentUser = res.data; if(self.profile.locked == true) {
if(res.data.locked == true) { self.visibility = 'private';
self.visibility = 'private'; self.visibilityTag = 'Followers Only';
self.visibilityTag = 'Followers Only';
} }
}).catch(err => { } else {
}); axios.get('/api/pixelfed/v1/accounts/verify_credentials').then(res => {
self.profile = res.data;
window.pixelfed.currentUser = res.data;
if(res.data.locked == true) {
self.visibility = 'private';
self.visibilityTag = 'Followers Only';
}
}).catch(err => {
});
}
}, },
addMedia(event) { addMedia(event) {