diff --git a/lib/reducers/message-reducer.js b/lib/reducers/message-reducer.js index 2fadf2951c..c83b691a8d 100644 --- a/lib/reducers/message-reducer.js +++ b/lib/reducers/message-reducer.js @@ -15,6 +15,10 @@ import _pickBy from 'lodash/fp/pickBy.js'; import _uniq from 'lodash/fp/uniq.js'; import { setClientDBStoreActionType } from '../actions/client-db-store-actions.js'; +import { + createOrUpdateFarcasterChannelTagActionTypes, + deleteFarcasterChannelTagActionTypes, +} from '../actions/community-actions.js'; import { createEntryActionTypes, saveEntryActionTypes, @@ -1046,6 +1050,21 @@ function reduceMessageStore( }, newThreadInfos, ); + } else if ( + (action.type === createOrUpdateFarcasterChannelTagActionTypes.success && + action.payload.newMessageInfos) || + (action.type === deleteFarcasterChannelTagActionTypes.success && + action.payload.newMessageInfos) + ) { + return mergeNewMessages( + messageStore, + action.payload.newMessageInfos, + { + [(action.payload.commCommunityID: string)]: + messageTruncationStatus.UNCHANGED, + }, + newThreadInfos, + ); } else if (action.type === deleteEntryActionTypes.success) { const payload = action.payload; if (payload) { diff --git a/lib/reducers/thread-reducer.js b/lib/reducers/thread-reducer.js index e5adb7ba68..0c373e9d7e 100644 --- a/lib/reducers/thread-reducer.js +++ b/lib/reducers/thread-reducer.js @@ -6,6 +6,10 @@ import { } from '../actions/activity-actions.js'; import { removePeerUsersActionType } from '../actions/aux-user-actions.js'; import { setClientDBStoreActionType } from '../actions/client-db-store-actions.js'; +import { + createOrUpdateFarcasterChannelTagActionTypes, + deleteFarcasterChannelTagActionTypes, +} from '../actions/community-actions.js'; import { saveMessagesActionType } from '../actions/message-actions.js'; import { legacySiweAuthActionTypes } from '../actions/siwe-actions.js'; import { @@ -264,8 +268,17 @@ function reduceThreadInfos( action.type === newThreadActionTypes.success || action.type === modifyCommunityRoleActionTypes.success || action.type === deleteCommunityRoleActionTypes.success || - action.type === removePeerUsersActionType + action.type === removePeerUsersActionType || + action.type === createOrUpdateFarcasterChannelTagActionTypes.success || + action.type === deleteFarcasterChannelTagActionTypes.success ) { + if (!action.payload.updatesResult) { + return { + threadStore: state, + newThreadInconsistencies: [], + threadStoreOperations: [], + }; + } const { newUpdates } = action.payload.updatesResult; if (newUpdates.length === 0) { return {