Skip to content

Commit e5f2cda

Browse files
committed
throw an error when no measures are found
1 parent 3499405 commit e5f2cda

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

src/components/ReactPerfDevtool.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class ReactPerfDevtool extends React.Component {
4040
this.setState({ loading: true })
4141

4242
// Set the timer, and get the total measures and flush them if the store is empty.
43-
this.timer = setInterval(() => this.getMeasuresLength(), 2000)
43+
this.timer = setInterval(() => this.getMeasuresLength(), 2300)
4444
}
4545

4646
componentWillUnmount() {
@@ -147,6 +147,8 @@ class ReactPerfDevtool extends React.Component {
147147
}
148148

149149
render() {
150+
const commonStyles = { fontWeight: 500, padding: '8px' }
151+
150152
return (
151153
<div
152154
style={{
@@ -158,18 +160,20 @@ class ReactPerfDevtool extends React.Component {
158160
<button onClick={this.reload}>Reload the inspected page</button>
159161
</div>
160162

161-
<div style={{ fontWeight: 500, padding: '8px' }}>
163+
<div style={commonStyles}>
162164
Pending Events: {this.state.pendingEvents}
163165
</div>
164-
<Table measures={this.state.perfData} />
165166
{this.state.hasError ? (
166-
this.state.errorMsg
167+
<div style={commonStyles}>{this.state.errorMsg}</div>
167168
) : (
168-
<Results
169-
rawMeasures={this.state.rawMeasures}
170-
totalTime={this.state.totalTime}
171-
loading={this.state.loading}
172-
/>
169+
<React.Fragment>
170+
<Table measures={this.state.perfData} />
171+
<Results
172+
rawMeasures={this.state.rawMeasures}
173+
totalTime={this.state.totalTime}
174+
loading={this.state.loading}
175+
/>
176+
</React.Fragment>
173177
)}
174178
</div>
175179
)

0 commit comments

Comments
 (0)