diff --git a/src/components/account-info.jsx b/src/components/account-info.jsx index 3f3abeba..6c719583 100644 --- a/src/components/account-info.jsx +++ b/src/components/account-info.jsx @@ -906,6 +906,8 @@ function RelatedActions({ info, instance, authenticated, standalone }) { setRelationship(newRelationship); setRelationshipUIState('default'); showToast(`Unmuted @${username}`); + states.reloadGenericAccounts.id = 'mute'; + states.reloadGenericAccounts.counter++; } catch (e) { console.error(e); setRelationshipUIState('error'); @@ -957,6 +959,8 @@ function RelatedActions({ info, instance, authenticated, standalone }) { showToast( `Muted @${username} for ${MUTE_DURATIONS_LABELS[duration]}`, ); + states.reloadGenericAccounts.id = 'mute'; + states.reloadGenericAccounts.counter++; } catch (e) { console.error(e); setRelationshipUIState('error'); @@ -1007,6 +1011,8 @@ function RelatedActions({ info, instance, authenticated, standalone }) { setRelationshipUIState('default'); showToast(`Blocked @${username}`); } + states.reloadGenericAccounts.id = 'block'; + states.reloadGenericAccounts.counter++; } catch (e) { console.error(e); setRelationshipUIState('error'); diff --git a/src/components/generic-accounts.jsx b/src/components/generic-accounts.jsx index ca269ed1..fbcb12aa 100644 --- a/src/components/generic-accounts.jsx +++ b/src/components/generic-accounts.jsx @@ -21,6 +21,7 @@ export default function GenericAccounts({ onClose = () => {} }) { } const { + id, heading, fetchAccounts, accounts: staticAccounts, @@ -60,6 +61,14 @@ export default function GenericAccounts({ onClose = () => {} }) { } }, [staticAccounts, fetchAccounts]); + useEffect(() => { + // reloadGenericAccounts contains value like {id: 'mute', counter: 1} + // We only need to reload if the id matches + if (snapStates.reloadGenericAccounts?.id === id) { + loadAccounts(true); + } + }, [snapStates.reloadGenericAccounts.counter]); + return (