mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-22 19:14:52 +01:00
also make filter request interruptable
This commit is contained in:
parent
cc19063c79
commit
52e2d3203e
@ -80,8 +80,8 @@ export class Sync {
|
||||
async _syncRequest(syncToken, timeout) {
|
||||
let {syncFilterId} = this._session;
|
||||
if (typeof syncFilterId !== "string") {
|
||||
// TODO: this should be interruptable by stop, we can reuse _currentRequest
|
||||
syncFilterId = (await this._hsApi.createFilter(this._session.user.id, {room: {state: {lazy_load_members: true}}}).response()).filter_id;
|
||||
this._currentRequest = this._hsApi.createFilter(this._session.user.id, {room: {state: {lazy_load_members: true}}});
|
||||
syncFilterId = (await this._currentRequest.response()).filter_id;
|
||||
}
|
||||
const totalRequestTimeout = timeout + (80 * 1000); // same as riot-web, don't get stuck on wedged long requests
|
||||
this._currentRequest = this._hsApi.sync(syncToken, syncFilterId, timeout, {timeout: totalRequestTimeout});
|
||||
|
Loading…
Reference in New Issue
Block a user