File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
packages/firestore/src/core Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -352,18 +352,21 @@ async function allocateTargetAndMaybeListen(
352
352
? syncEngineImpl . sharedClientState . addLocalQueryTarget ( targetId )
353
353
: 'not-current' ;
354
354
355
- if ( syncEngineImpl . isPrimaryClient && shouldListenToRemote ) {
356
- remoteStoreListen ( syncEngineImpl . remoteStore , targetData ) ;
357
- }
358
-
355
+ let viewSnapshot ;
359
356
if ( shouldInitializeView ) {
360
- return initializeViewAndComputeSnapshot (
357
+ viewSnapshot = await initializeViewAndComputeSnapshot (
361
358
syncEngineImpl ,
362
359
query ,
363
360
targetId ,
364
361
status === 'current' ,
365
362
targetData . resumeToken
366
363
) ;
364
+
365
+ if ( syncEngineImpl . isPrimaryClient && shouldListenToRemote ) {
366
+ remoteStoreListen ( syncEngineImpl . remoteStore , targetData ) ;
367
+ }
368
+
369
+ return viewSnapshot ;
367
370
}
368
371
}
369
372
You can’t perform that action at this time.
0 commit comments