logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://hacktivis.me/git/pleroma-fe.git
commit: f56298adbd6fc4b30f759f58336f881e9ebfab65
parent fa5d35523dd081b6948d38325374cac5707b7868
Author: Sean King <seanking2919@protonmail.com>
Date:   Tue, 21 Jun 2022 17:44:04 -0600

Add ability to detect whether backend supports editing

Diffstat:

Msrc/App.js1+
Msrc/App.vue4++--
Msrc/boot/after_store.js1+
Msrc/components/extra_buttons/extra_buttons.js3++-
Msrc/components/extra_buttons/extra_buttons.vue4++--
5 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/App.js b/src/App.js @@ -94,6 +94,7 @@ export default { return this.$store.getters.mergedConfig.alwaysShowNewPostButton || this.layoutType === 'mobile' }, showFeaturesPanel () { return this.$store.state.instance.showFeaturesPanel }, + editingAvailable () { return this.$store.state.instance.editingAvailable }, shoutboxPosition () { return this.$store.getters.mergedConfig.alwaysShowNewPostButton || false }, diff --git a/src/App.vue b/src/App.vue @@ -52,8 +52,8 @@ <MobilePostStatusButton /> <UserReportingModal /> <PostStatusModal /> - <EditStatusModal /> - <StatusHistoryModal /> + <EditStatusModal v-if="editingAvailable" /> + <StatusHistoryModal v-if="editingAvailable" /> <SettingsModal /> <div id="modal" /> <GlobalNoticeList /> diff --git a/src/boot/after_store.js b/src/boot/after_store.js @@ -251,6 +251,7 @@ const getNodeInfo = async ({ store }) => { store.dispatch('setInstanceOption', { name: 'pleromaChatMessagesAvailable', value: features.includes('pleroma_chat_messages') }) store.dispatch('setInstanceOption', { name: 'gopherAvailable', value: features.includes('gopher') }) store.dispatch('setInstanceOption', { name: 'pollsAvailable', value: features.includes('polls') }) + store.dispatch('setInstanceOption', { name: 'editingAvailable', value: features.includes('editing') }) store.dispatch('setInstanceOption', { name: 'pollLimits', value: metadata.pollLimits }) store.dispatch('setInstanceOption', { name: 'mailerEnabled', value: metadata.mailerEnabled }) diff --git a/src/components/extra_buttons/extra_buttons.js b/src/components/extra_buttons/extra_buttons.js @@ -123,7 +123,8 @@ const ExtraButtons = { }, isEdited () { return this.status.edited_at !== null - } + }, + editingAvailable () { return this.$store.state.instance.editingAvailable } } } diff --git a/src/components/extra_buttons/extra_buttons.vue b/src/components/extra_buttons/extra_buttons.vue @@ -74,7 +74,7 @@ /><span>{{ $t("status.unbookmark") }}</span> </button> <button - v-if="ownStatus" + v-if="ownStatus && editingAvailable" class="button-default dropdown-item dropdown-item-icon" @click.prevent="editStatus" @click="close" @@ -85,7 +85,7 @@ /><span>{{ $t("status.edit") }}</span> </button> <button - v-if="isEdited" + v-if="isEdited && editingAvailable" class="button-default dropdown-item dropdown-item-icon" @click.prevent="showStatusHistory" @click="close"