From a7e887d0c4b5f7d8598bd3a6843a474d89bc7053 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 26 Oct 2025 21:00:23 +0000 Subject: [PATCH 1/2] Convert Immutable data structures to plain JS objects in modals and components MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The mute button and other dialog modals were still not working because while the dialog state objects were converted to plain JS, the list data (mutelist, blacklistedList, followedMutedList, etc.) were still Immutable Lists from the Redux store. This caused issues when components tried to use array methods like .includes() or spread operators on these lists. Fixed files: - MuteModal: Convert mutelist to plain JS array - BlacklistModal: Convert blacklistedList to plain JS array - FollowMutedListModal: Convert followedMutedList to plain JS array - FollowBlacklistsModal: Convert followedBlacklist to plain JS array - HideBuzzModal: Convert mutelist to plain JS array - MuteButton: Convert mutedList and mutedListAll to plain JS arrays - Profile page: Convert mutelist to plain JS array This ensures all components work with native JavaScript data structures instead of Immutable.js collections, fixing the mute button and all related dialog functionality. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/components/common/MuteButton/index.js | 4 ++-- src/components/modals/BlacklistModal/index.js | 2 +- src/components/modals/FollowBlacklistsModal/index.js | 2 +- src/components/modals/FollowMutedListModal/index.js | 2 +- src/components/modals/HideBuzzModal/index.js | 2 +- src/components/modals/MuteModal/index.js | 2 +- src/components/pages/Profile/index.js | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/common/MuteButton/index.js b/src/components/common/MuteButton/index.js index d8805766..6832f80a 100644 --- a/src/components/common/MuteButton/index.js +++ b/src/components/common/MuteButton/index.js @@ -84,8 +84,8 @@ const MuteButton = (props) => { } const mapStateToProps = (state) => ({ - mutedList: state.profile.get('mutedList'), - mutedListAll: state.profile.get('mutedListAll'), + mutedList: state.profile.get('mutedList')?.toJS ? state.profile.get('mutedList').toJS() : state.profile.get('mutedList'), + mutedListAll: state.profile.get('mutedListAll')?.toJS ? state.profile.get('mutedListAll').toJS() : state.profile.get('mutedListAll'), }) diff --git a/src/components/modals/BlacklistModal/index.js b/src/components/modals/BlacklistModal/index.js index 8a1d0e9b..44a4e5b6 100644 --- a/src/components/modals/BlacklistModal/index.js +++ b/src/components/modals/BlacklistModal/index.js @@ -205,7 +205,7 @@ const mapStateToProps = (state) => ({ theme: state.settings.get('theme'), blacklistModal: state.interfaces.get('blacklistDialog')?.toJS ? state.interfaces.get('blacklistDialog').toJS() : state.interfaces.get('blacklistDialog'), loading: pending(state, 'BLACKLIST_USER_REQUEST') || pending(state, 'UNBLACKLIST_USER_REQUEST'), - blacklistedList: state.profile.get('blacklistedList'), + blacklistedList: state.profile.get('blacklistedList')?.toJS ? state.profile.get('blacklistedList').toJS() : state.profile.get('blacklistedList'), }) const mapDispatchToProps = (dispatch) => ({ diff --git a/src/components/modals/FollowBlacklistsModal/index.js b/src/components/modals/FollowBlacklistsModal/index.js index ee35ef13..d13c59e2 100644 --- a/src/components/modals/FollowBlacklistsModal/index.js +++ b/src/components/modals/FollowBlacklistsModal/index.js @@ -236,7 +236,7 @@ const mapStateToProps = (state) => ({ theme: state.settings.get('theme'), followBlacklistsDialog: state.interfaces.get('followBlacklistsDialog')?.toJS ? state.interfaces.get('followBlacklistsDialog').toJS() : state.interfaces.get('followBlacklistsDialog'), loading: pending(state, 'FOLLOW_BLACKLISTS_REQUEST') || pending(state, 'UNFOLLOW_BLACKLISTS_REQUEST'), - followedBlacklist: state.profile.get('followedBlacklist'), + followedBlacklist: state.profile.get('followedBlacklist')?.toJS ? state.profile.get('followedBlacklist').toJS() : state.profile.get('followedBlacklist'), }) const mapDispatchToProps = (dispatch) => ({ diff --git a/src/components/modals/FollowMutedListModal/index.js b/src/components/modals/FollowMutedListModal/index.js index 5a86e248..632c7769 100644 --- a/src/components/modals/FollowMutedListModal/index.js +++ b/src/components/modals/FollowMutedListModal/index.js @@ -236,7 +236,7 @@ const mapStateToProps = (state) => ({ theme: state.settings.get('theme'), followMutedModal: state.interfaces.get('followMutedListDialog')?.toJS ? state.interfaces.get('followMutedListDialog').toJS() : state.interfaces.get('followMutedListDialog'), loading: pending(state, 'FOLLOW_MUTED_LIST_REQUEST') || pending(state, 'UNFOLLOW_MUTED_LIST_REQUEST'), - followedMutedList: state.profile.get('followedMuted'), + followedMutedList: state.profile.get('followedMuted')?.toJS ? state.profile.get('followedMuted').toJS() : state.profile.get('followedMuted'), }) const mapDispatchToProps = (dispatch) => ({ diff --git a/src/components/modals/HideBuzzModal/index.js b/src/components/modals/HideBuzzModal/index.js index 4232f364..0075da6b 100644 --- a/src/components/modals/HideBuzzModal/index.js +++ b/src/components/modals/HideBuzzModal/index.js @@ -177,7 +177,7 @@ const mapStateToProps = (state) => ({ theme: state.settings.get('theme'), hideBuzzDialog: state.interfaces.get('hideBuzzDialog')?.toJS ? state.interfaces.get('hideBuzzDialog').toJS() : state.interfaces.get('hideBuzzDialog'), loading: pending(state, 'HIDE_BUZZ_REQUEST'), - mutelist: state.auth.get('mutelist'), + mutelist: state.auth.get('mutelist')?.toJS ? state.auth.get('mutelist').toJS() : state.auth.get('mutelist'), }) const mapDispatchToProps = (dispatch) => ({ diff --git a/src/components/modals/MuteModal/index.js b/src/components/modals/MuteModal/index.js index 07809bc4..f3a02a73 100644 --- a/src/components/modals/MuteModal/index.js +++ b/src/components/modals/MuteModal/index.js @@ -250,7 +250,7 @@ const mapStateToProps = (state) => ({ theme: state.settings.get('theme'), muteModal: state.interfaces.get('muteDialogUser')?.toJS ? state.interfaces.get('muteDialogUser').toJS() : state.interfaces.get('muteDialogUser'), loading: pending(state, 'MUTE_USER_REQUEST'), - mutelist: state.auth.get('mutelist'), + mutelist: state.auth.get('mutelist')?.toJS ? state.auth.get('mutelist').toJS() : state.auth.get('mutelist'), }) const mapDispatchToProps = (dispatch) => ({ diff --git a/src/components/pages/Profile/index.js b/src/components/pages/Profile/index.js index ae1caa3f..26024031 100644 --- a/src/components/pages/Profile/index.js +++ b/src/components/pages/Profile/index.js @@ -978,7 +978,7 @@ const mapStateToProps = (state) => ({ loadingFollow: pending(state, 'FOLLOW_REQUEST') || pending(state, 'UNFOLLOW_REQUEST'), recentFollows: state.posts.get('hasBeenRecentlyFollowed'), recentUnfollows: state.posts.get('hasBeenRecentlyUnfollowed'), - mutelist: state.auth.get('mutelist'), + mutelist: state.auth.get('mutelist')?.toJS ? state.auth.get('mutelist').toJS() : state.auth.get('mutelist'), follows: state.profile.get('following'), }) From 8182810b86abe6b3d91c88318ddcb71d156f8f67 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 26 Oct 2025 21:22:15 +0000 Subject: [PATCH 2/2] Add debugging logs to trace mute button click flow --- src/components/modals/MuteModal/index.js | 4 ++++ src/components/pages/Profile/index.js | 2 ++ src/store/interface/reducers.js | 2 ++ 3 files changed, 8 insertions(+) diff --git a/src/components/modals/MuteModal/index.js b/src/components/modals/MuteModal/index.js index f3a02a73..4c834abb 100644 --- a/src/components/modals/MuteModal/index.js +++ b/src/components/modals/MuteModal/index.js @@ -117,8 +117,12 @@ const MuteModal = (props) => { const { muteSuccessCallback } = muteModal useEffect(() => { + console.log('MuteModal useEffect - muteModal:', muteModal) + console.log('MuteModal useEffect - muteModal type:', typeof muteModal, muteModal?.constructor?.name) + console.log('MuteModal useEffect - has open prop?', muteModal?.hasOwnProperty('open')) if(muteModal && muteModal.hasOwnProperty('open')) { const { open, username } = muteModal + console.log('MuteModal opening - open:', open, 'username:', username) setOpen(open) setUsername(username) if(mutelist.includes(username)) { diff --git a/src/components/pages/Profile/index.js b/src/components/pages/Profile/index.js index 26024031..fa158617 100644 --- a/src/components/pages/Profile/index.js +++ b/src/components/pages/Profile/index.js @@ -370,6 +370,8 @@ const Profile = (props) => { } const openMuteModal = () => { + console.log('openMuteModal called for username:', username) + console.log('openMuteDialog function:', typeof openMuteDialog) openMuteDialog(username) } diff --git a/src/store/interface/reducers.js b/src/store/interface/reducers.js index aeaae02f..a333a2c4 100644 --- a/src/store/interface/reducers.js +++ b/src/store/interface/reducers.js @@ -79,8 +79,10 @@ export const interfaces = (state = defaultState, { type, payload }) => { case SET_BUZZ_CONFIRM_MODAL_STATUS: return state.set('buzzConfirmModalStatus', payload) case OPEN_MUTE_DIALOG: + console.log('OPEN_MUTE_DIALOG reducer - payload:', payload) return state.set('muteDialogUser', { open: true, ...payload }) case CLOSE_MUTE_DIALOG: + console.log('CLOSE_MUTE_DIALOG reducer') return state.set('muteDialogUser', { open: false, username: null }) case OPEN_HIDE_BUZZ_DIALOG: return state.set('hideBuzzDialog', { open: true, ...payload })