mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix(topbar): didn't update when subscribing to a board
This commit is contained in:
@@ -108,7 +108,9 @@ const TopBarDesktop = () => {
|
|||||||
(state) => {
|
(state) => {
|
||||||
const activeAccountId = state.activeAccountId;
|
const activeAccountId = state.activeAccountId;
|
||||||
const activeAccount = activeAccountId ? state.accounts[activeAccountId] : undefined;
|
const activeAccount = activeAccountId ? state.accounts[activeAccountId] : undefined;
|
||||||
return activeAccount?.subscriptions || [];
|
// Spread to create new reference - if array is mutated in place, the equality
|
||||||
|
// function needs different references to detect content changes
|
||||||
|
return [...(activeAccount?.subscriptions || [])];
|
||||||
},
|
},
|
||||||
(prev, next) => {
|
(prev, next) => {
|
||||||
// Shallow compare arrays - only rerender if subscriptions actually change
|
// Shallow compare arrays - only rerender if subscriptions actually change
|
||||||
|
|||||||
Reference in New Issue
Block a user