Fixed a state cleanup issue if Profiler data is cleared

This commit is contained in:
Brian Vaughn
2019-05-22 09:04:55 -07:00
parent d1344768b2
commit fbd82385d2
2 changed files with 18 additions and 15 deletions
+2 -1
View File
@@ -153,12 +153,13 @@ export default class ProfilerStore extends EventEmitter {
this._initialSnapshotsByRootID.clear();
this._inProgressOperationsByRootID.clear();
this._inProgressScreenshotsByRootID.clear();
this._rendererQueue.clear();
// Invalidate suspense cache if profiling data is being (re-)recorded.
// Note that we clear now because any existing data is "stale".
this._cache.invalidate();
this.emit('isProfiling');
this.emit('profilingData');
}
startProfiling(): void {
+16 -14
View File
@@ -63,20 +63,22 @@ function Profiler({ supportsProfiling }: Props) {
}
let sidebar = null;
switch (selectedTabID) {
case 'interactions':
sidebar = <SidebarInteractions />;
break;
case 'flame-chart':
case 'ranked-chart':
if (selectedFiberID !== null) {
sidebar = <SidebarSelectedFiberInfo />;
} else {
sidebar = <SidebarCommitInfo />;
}
break;
default:
break;
if (!isProfiling && !isProcessingData && hasProfilingData) {
switch (selectedTabID) {
case 'interactions':
sidebar = <SidebarInteractions />;
break;
case 'flame-chart':
case 'ranked-chart':
if (selectedFiberID !== null) {
sidebar = <SidebarSelectedFiberInfo />;
} else {
sidebar = <SidebarCommitInfo />;
}
break;
default:
break;
}
}
return (