File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -550,6 +550,16 @@ function keysChanged<TKey extends CollectionKeyBase>(
550550 const previousCollection = partialPreviousCollection ?? { } ;
551551 const changedMemberKeys = Object . keys ( partialCollection ?? { } ) ;
552552
553+ // Add or remove the keys from the recentlyAccessedKeys list
554+ for ( const memberKey of changedMemberKeys ) {
555+ const value = partialCollection ?. [ memberKey ] ;
556+ if ( value !== null && value !== undefined ) {
557+ cache . addLastAccessedKey ( memberKey , false ) ;
558+ } else {
559+ cache . removeLastAccessedKey ( memberKey ) ;
560+ }
561+ }
562+
553563 // Use indexed lookup instead of scanning all subscribers.
554564 // We need subscribers for: (1) the collection key itself, and (2) individual changed member keys.
555565 const collectionSubscriberIDs = onyxKeyToSubscriptionIDs . get ( collectionKey ) ?? [ ] ;
You can’t perform that action at this time.
0 commit comments