From e975372631724c234535b669b17745e6c0de8d00 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 14 Dec 2021 22:25:50 -0700 Subject: [PATCH] Update ComposeModal --- resources/assets/js/components/ComposeModal.vue | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/resources/assets/js/components/ComposeModal.vue b/resources/assets/js/components/ComposeModal.vue index acc332f2d..94a011936 100644 --- a/resources/assets/js/components/ComposeModal.vue +++ b/resources/assets/js/components/ComposeModal.vue @@ -1024,7 +1024,6 @@ export default { }, beforeMount() { - this.fetchProfile(); this.filters = window.App.util.filters; axios.get('/api/compose/v0/settings') .then(res => { @@ -1038,6 +1037,7 @@ export default { return l.title; })[0]; } + this.fetchProfile(); }); }, @@ -1047,8 +1047,18 @@ export default { methods: { fetchProfile() { + let tags = { + public: 'Public', + private: 'Followers Only', + unlisted: 'Unlisted' + } if(window._sharedData.curUser.id) { this.profile = window._sharedData.curUser; + if(this.composeSettings && this.composeSettings.hasOwnProperty('default_scope') && this.composeSettings.default_scope) { + let ds = this.composeSettings.default_scope; + this.visibility = ds; + this.visibilityTag = tags[ds]; + } if(this.profile.locked == true) { this.visibility = 'private'; this.visibilityTag = 'Followers Only'; @@ -1057,6 +1067,11 @@ export default { axios.get('/api/pixelfed/v1/accounts/verify_credentials').then(res => { window._sharedData.currentUser = res.data; this.profile = res.data; + if(this.composeSettings && this.composeSettings.hasOwnProperty('default_scope') && this.composeSettings.default_scope) { + let ds = this.composeSettings.default_scope; + this.visibility = ds; + this.visibilityTag = tags[ds]; + } if(this.profile.locked == true) { this.visibility = 'private'; this.visibilityTag = 'Followers Only';