File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -471,8 +471,7 @@ class OnyxCache {
471471 return undefined ;
472472 }
473473
474- // Return a shallow copy to ensure React detects changes when items are added/removed
475- return { ...cachedCollection } ;
474+ return cachedCollection ;
476475 }
477476}
478477
Original file line number Diff line number Diff line change @@ -530,7 +530,8 @@ function tryGetCachedValue<TKey extends OnyxKey>(key: TKey): OnyxValue<OnyxKey>
530530 if ( isCollectionKey ( key ) ) {
531531 const collectionData = cache . getCollectionData ( key ) ;
532532 if ( collectionData !== undefined ) {
533- val = collectionData ;
533+ // Return a shallow copy to ensure React detects changes when items are added/removed
534+ val = { ...collectionData } ;
534535 } else {
535536 // If we haven't loaded all keys yet, we can't determine if the collection exists
536537 if ( cache . getAllKeys ( ) . size === 0 ) {
You can’t perform that action at this time.
0 commit comments