You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-11 20:22:36 +03:00
wait longer to arrive at #home but poll every 100ms
This commit is contained in:
@@ -201,4 +201,17 @@ module.exports = class RiotSession {
|
||||
close() {
|
||||
return this.browser.close();
|
||||
}
|
||||
|
||||
async poll(callback, timeout) {
|
||||
const INTERVAL = 100;
|
||||
let waited = 0;
|
||||
while(waited < timeout) {
|
||||
await this.delay(INTERVAL);
|
||||
waited += INTERVAL;
|
||||
if (callback()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user