File tree Expand file tree Collapse file tree
packages/api/src/providers/ActivityKeyer Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -115,12 +115,19 @@ const ActivityKeyerComposer = ({ children }: Readonly<{ children?: ReactNode | u
115115
116116 prevActivitiesRef . current = activities ;
117117
118- if ( ! newKeys . length ) {
119- return prevActivityKeysStateRef . current ;
118+ if ( newKeys . length ) {
119+ const nextKeys = Object . freeze ( [ ...prevActivityKeysStateRef . current [ 0 ] , ...newKeys ] ) ;
120+ const result = Object . freeze ( [ nextKeys ] ) as readonly [ readonly string [ ] ] ;
121+
122+ prevActivityKeysStateRef . current = result ;
123+
124+ return result ;
120125 }
121126
122- const nextKeys = Object . freeze ( [ ...prevActivityKeysStateRef . current [ 0 ] , ...newKeys ] ) ;
123- const result = Object . freeze ( [ nextKeys ] ) as readonly [ readonly string [ ] ] ;
127+ // New activities were added to existing keys — no new keys, but the keyToActivitiesMap
128+ // was mutated. Return a new tuple reference so context consumers re-render and see the
129+ // updated activities-per-key via getActivitiesByKey.
130+ const result = Object . freeze ( [ prevActivityKeysStateRef . current [ 0 ] ] ) as readonly [ readonly string [ ] ] ;
124131
125132 prevActivityKeysStateRef . current = result ;
126133
You can’t perform that action at this time.
0 commit comments