File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -847,7 +847,7 @@ function addKeyToRecentlyAccessedIfNeeded<TKey extends OnyxKey>(key: TKey): void
847847function getCollectionDataAndSendAsObject < TKey extends OnyxKey > ( matchingKeys : CollectionKeyBase [ ] , mapping : CallbackToStateMapping < TKey > ) : void {
848848 multiGet ( matchingKeys ) . then ( ( dataMap ) => {
849849 const data = Object . fromEntries ( dataMap . entries ( ) ) as OnyxValue < TKey > ;
850- sendDataToConnection ( mapping , data , undefined ) ;
850+ sendDataToConnection ( mapping , data , mapping . key ) ;
851851 } ) ;
852852}
853853
@@ -1173,9 +1173,12 @@ function subscribeToKey<TKey extends OnyxKey>(connectOptions: ConnectOptions<TKe
11731173 cache . addNullishStorageKey ( mapping . key ) ;
11741174 }
11751175
1176+ const shouldSendCollectionKey = isCollectionKey ( mapping . key ) && mapping . waitForCollectionCallback ;
1177+ const matchedKey = shouldSendCollectionKey ? mapping . key : undefined ;
1178+
11761179 // Here we cannot use batching because the nullish value is expected to be set immediately for default props
11771180 // or they will be undefined.
1178- sendDataToConnection ( mapping , null , undefined ) ;
1181+ sendDataToConnection ( mapping , null , matchedKey ) ;
11791182 return ;
11801183 }
11811184
You can’t perform that action at this time.
0 commit comments