@@ -289,6 +289,10 @@ export default class ProfilerStore extends EventEmitter<{
289
289
} ;
290
290
291
291
onProfilingStatus: ( isProfiling : boolean ) => void = isProfiling => {
292
+ if ( this . _isProfiling === isProfiling ) {
293
+ return ;
294
+ }
295
+
292
296
if ( isProfiling ) {
293
297
this . _dataBackends . splice ( 0 ) ;
294
298
this . _dataFrontend = null ;
@@ -315,36 +319,34 @@ export default class ProfilerStore extends EventEmitter<{
315
319
} ) ;
316
320
}
317
321
318
- if ( this . _isProfiling !== isProfiling ) {
319
- this . _isProfiling = isProfiling ;
322
+ this . _isProfiling = isProfiling ;
320
323
321
- // Invalidate suspense cache if profiling data is being (re-)recorded.
322
- // Note that we clear again, in case any views read from the cache while profiling.
323
- // (That would have resolved a now-stale value without any profiling data.)
324
- this . _cache . invalidate ( ) ;
324
+ // Invalidate suspense cache if profiling data is being (re-)recorded.
325
+ // Note that we clear again, in case any views read from the cache while profiling.
326
+ // (That would have resolved a now-stale value without any profiling data.)
327
+ this . _cache . invalidate ( ) ;
325
328
326
- this . emit ( 'isProfiling' ) ;
329
+ this . emit ( 'isProfiling' ) ;
327
330
328
- // If we've just finished a profiling session, we need to fetch data stored in each renderer interface
329
- // and re-assemble it on the front-end into a format (ProfilingDataFrontend) that can power the Profiler UI.
330
- // During this time, DevTools UI should probably not be interactive.
331
- if ( ! isProfiling ) {
332
- this . _dataBackends . splice ( 0 ) ;
333
- this . _rendererQueue . clear ( ) ;
331
+ // If we've just finished a profiling session, we need to fetch data stored in each renderer interface
332
+ // and re-assemble it on the front-end into a format (ProfilingDataFrontend) that can power the Profiler UI.
333
+ // During this time, DevTools UI should probably not be interactive.
334
+ if ( ! isProfiling ) {
335
+ this . _dataBackends . splice ( 0 ) ;
336
+ this . _rendererQueue . clear ( ) ;
334
337
335
- // Only request data from renderers that actually logged it.
336
- // This avoids unnecessary bridge requests and also avoids edge case mixed renderer bugs.
337
- // (e.g. when v15 and v16 are both present)
338
- this . _rendererIDsThatReportedProfilingData . forEach ( rendererID => {
339
- if ( ! this . _rendererQueue . has ( rendererID ) ) {
340
- this . _rendererQueue . add ( rendererID ) ;
338
+ // Only request data from renderers that actually logged it.
339
+ // This avoids unnecessary bridge requests and also avoids edge case mixed renderer bugs.
340
+ // (e.g. when v15 and v16 are both present)
341
+ this . _rendererIDsThatReportedProfilingData . forEach ( rendererID => {
342
+ if ( ! this . _rendererQueue . has ( rendererID ) ) {
343
+ this . _rendererQueue . add ( rendererID ) ;
341
344
342
- this . _bridge . send ( 'getProfilingData' , { rendererID} ) ;
343
- }
344
- } ) ;
345
+ this . _bridge . send ( 'getProfilingData' , { rendererID} ) ;
346
+ }
347
+ } ) ;
345
348
346
- this . emit ( 'isProcessingData' ) ;
347
- }
349
+ this . emit ( 'isProcessingData' ) ;
348
350
}
349
351
} ;
350
352
}
0 commit comments