From ef0cba713d1befdb0a07b0a49d7cf0d5c1f11238 Mon Sep 17 00:00:00 2001 From: Lain Soykaf Date: Wed, 13 May 2026 11:14:12 +0400 Subject: [PATCH 1/2] fix reply form quote config access --- .../post_status_form/post_status_form.js | 2 +- .../status_action_buttons.js | 2 +- .../specs/components/post_status_form.spec.js | 61 +++++++++++++++++++ 3 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 test/unit/specs/components/post_status_form.spec.js diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index d08a8b9c2..a1ca37a2e 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -380,7 +380,7 @@ const PostStatusForm = { if ( !this.quotingAvailable || !this.isReply || - !this.$store.getters.mergedConfig.quoteReply + !useMergedConfigStore().mergedConfig.quoteReply ) { return false } diff --git a/src/components/status_action_buttons/status_action_buttons.js b/src/components/status_action_buttons/status_action_buttons.js index 9938e6382..74aeb6025 100644 --- a/src/components/status_action_buttons/status_action_buttons.js +++ b/src/components/status_action_buttons/status_action_buttons.js @@ -16,7 +16,7 @@ library.add(faEllipsisH) const StatusActionButtons = { props: ['status', 'replying'], - emits: ['toggleReplying', 'interacted'], + emits: ['toggleReplying', 'interacted', 'onSuccess', 'onError'], data() { return { showPin: false, diff --git a/test/unit/specs/components/post_status_form.spec.js b/test/unit/specs/components/post_status_form.spec.js new file mode 100644 index 000000000..8f3d6d80f --- /dev/null +++ b/test/unit/specs/components/post_status_form.spec.js @@ -0,0 +1,61 @@ +import { createTestingPinia } from '@pinia/testing' +import { mount } from '@vue/test-utils' +import { setActivePinia } from 'pinia' + +import PostStatusForm from 'src/components/post_status_form/post_status_form.vue' +import { mountOpts } from '../../../fixtures/setup_test' + +import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js' + +const currentUser = { + id: 'current-user', + default_scope: 'public', + locked: false, +} + +const repliedUser = { + id: 'replied-user', + screen_name: 'replied', +} + +const repliedStatus = { + id: 'status-1', + visibility: 'public', + user: repliedUser, +} + +const replyMountOpts = () => + mountOpts({ + props: { + replyTo: repliedStatus.id, + repliedUser, + attentions: [], + copyMessageScope: repliedStatus.visibility, + disableDraft: true, + }, + afterStore(store) { + store.state.users.currentUser = currentUser + store.state.statuses.allStatusesObject = { + [repliedStatus.id]: repliedStatus, + } + }, + }) + +describe('PostStatusForm', () => { + beforeEach(() => { + setActivePinia(createTestingPinia()) + }) + + it('initializes a reply form when quoteReply is unset', () => { + useInstanceCapabilitiesStore().quotingAvailable = true + + const wrapper = mount(PostStatusForm, replyMountOpts()) + + expect(wrapper.vm.newStatus.type).to.equal('reply') + expect(wrapper.vm.newStatus.quote).to.eql({ + id: '', + url: '', + thread: false, + }) + }) +}) From 304655d4487b644b5396cd2c3d1dd05121fda0b0 Mon Sep 17 00:00:00 2001 From: Lain Soykaf Date: Wed, 13 May 2026 11:26:48 +0400 Subject: [PATCH 2/2] fix lint and add changelog entry --- changelog.d/reply-quote-config.fix | 1 + .../mrf_transparency_panel/mrf_transparency_panel.js | 10 +++------- src/services/notification_utils/notification_utils.js | 5 ++++- src/stores/sync_config.js | 4 +--- src/stores/user_highlight.js | 5 ++++- 5 files changed, 13 insertions(+), 12 deletions(-) create mode 100644 changelog.d/reply-quote-config.fix diff --git a/changelog.d/reply-quote-config.fix b/changelog.d/reply-quote-config.fix new file mode 100644 index 000000000..b6ac4e5e9 --- /dev/null +++ b/changelog.d/reply-quote-config.fix @@ -0,0 +1 @@ +Fix reply form crash when quote-reply settings are unavailable diff --git a/src/components/mrf_transparency_panel/mrf_transparency_panel.js b/src/components/mrf_transparency_panel/mrf_transparency_panel.js index d77a0a839..b2048984d 100644 --- a/src/components/mrf_transparency_panel/mrf_transparency_panel.js +++ b/src/components/mrf_transparency_panel/mrf_transparency_panel.js @@ -1,5 +1,6 @@ import { get } from 'lodash' import { mapState } from 'pinia' + import { useInstanceStore } from 'src/stores/instance.js' /** @@ -21,16 +22,11 @@ const MRFTransparencyPanel = { computed: { ...mapState(useInstanceStore, { federationPolicy: (state) => state.federationPolicy, - mrfPolicies: (state) => - get(state, 'federationPolicy.mrf_policies', []), + mrfPolicies: (state) => get(state, 'federationPolicy.mrf_policies', []), quarantineInstances: (state) => toInstanceReasonObject( get(state, 'federationPolicy.quarantined_instances', []), - get( - state, - 'federationPolicy.quarantined_instances_info', - [], - ), + get(state, 'federationPolicy.quarantined_instances_info', []), 'quarantined_instances', ), acceptInstances: (state) => diff --git a/src/services/notification_utils/notification_utils.js b/src/services/notification_utils/notification_utils.js index 1fbaf2a2c..921600094 100644 --- a/src/services/notification_utils/notification_utils.js +++ b/src/services/notification_utils/notification_utils.js @@ -81,7 +81,10 @@ export const maybeShowNotification = ( if (notification.seen) return if (!visibleTypes(notificationVisibility).includes(notification.type)) return - if (notification.type === 'mention' && isMutedNotification(muteFilters, notification)) + if ( + notification.type === 'mention' && + isMutedNotification(muteFilters, notification) + ) return const notificationObject = prepareNotificationObject( diff --git a/src/stores/sync_config.js b/src/stores/sync_config.js index 722dd7f16..1caa2b030 100644 --- a/src/stores/sync_config.js +++ b/src/stores/sync_config.js @@ -14,8 +14,8 @@ import { uniqWith, unset, } from 'lodash' -import { v4 as uuidv4 } from 'uuid' import { defineStore } from 'pinia' +import { v4 as uuidv4 } from 'uuid' import { toRaw } from 'vue' import { CURRENT_UPDATE_COUNTER } from 'src/components/update_notification/update_notification.js' @@ -684,8 +684,6 @@ export const useSyncConfigStore = defineStore('sync_config', { `Already migrated Values: ${[...migratedEntries].join() || '[none]'}`, ) - const { configMigration } = useSyncConfigStore().flagStorage - Object.entries(oldDefaultConfigSync).forEach(([key, value]) => { const oldValue = config[key] const defaultValue = value diff --git a/src/stores/user_highlight.js b/src/stores/user_highlight.js index 5ca13b6a9..f41c41628 100644 --- a/src/stores/user_highlight.js +++ b/src/stores/user_highlight.js @@ -292,7 +292,10 @@ export const useUserHighlightStore = defineStore('user_highlight', { ) } }) - storage.setItem('vuex-lz', { ...vuexState, config: { ...config, highlight } }) + storage.setItem('vuex-lz', { + ...vuexState, + config: { ...config, highlight }, + }) if (recent === null) { console.debug(