@samitouri / QOS-React / commits / 2a80f8ca9c

Show is-recording indicator earlier after a reload-and-profile

Brian Vaughn committed Apr 1, 2019 at 14:43 UTC 2a80f8ca9ca0be44cca9539d83ede9a5d62b62d0
2 files changed +7
shells/browser/shared/src/main.js
+3
@@ -78,15 +78,18 @@ function createPanelIfReactLoaded() {
78 // This flag lets us tip the Store off early that we expect to be profiling.
79 // This avoids flashing a temporary "Profiling not supported" message in the Profiler tab,
80 // after a user has clicked the "reload and profile" button.
81 + let isProfiling = false;
82 let supportsProfiling = false;
83 if (localStorage.getItem(SUPPORTS_PROFILING_KEY) === 'true') {
84 supportsProfiling = true;
85 + isProfiling = true;
86 localStorage.removeItem(SUPPORTS_PROFILING_KEY);
87 }
88
89 const browserName = getBrowserName();
90
91 store = new Store(bridge, {
92 + isProfiling,
93 supportsFileDownloads: browserName === 'Chrome',
94 supportsReloadAndProfile: true,
95 supportsProfiling,
src/devtools/store.js
+4
@@ -103,10 +103,14 @@ export default class Store extends EventEmitter {
103
104 if (config != null) {
105 const {
106 + isProfiling,
107 supportsFileDownloads,
108 supportsProfiling,
109 supportsReloadAndProfile,
110 } = config;
111 + if (isProfiling) {
112 + this._isProfiling = true;
113 + }
114 if (supportsFileDownloads) {
115 this._supportsFileDownloads = true;
116 }