fix: enforce elapsed loading display minimum after timer wakes
This commit is contained in:
+5
-1
@@ -81,7 +81,11 @@ export class LocalPlatformLogin extends Component {
|
||||
waitForMinimumDisplay: async () => {
|
||||
await firstDraw;
|
||||
const drawnAt = this.required(this.firstDrawAt, 'loading first draw');
|
||||
await this.delay(Math.max(0, MINIMUM_LOADING_MS - (performance.now() - drawnAt)));
|
||||
let remaining = MINIMUM_LOADING_MS - (performance.now() - drawnAt);
|
||||
while (remaining > 0) {
|
||||
await this.delay(remaining);
|
||||
remaining = MINIMUM_LOADING_MS - (performance.now() - drawnAt);
|
||||
}
|
||||
this.record({ kind: 'minimum-display-ready', data: performance.now() - drawnAt });
|
||||
},
|
||||
createSocket: url => new WebSocket(url), record: event => this.record(event),
|
||||
|
||||
Reference in New Issue
Block a user