1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-12-13 07:42:14 +03:00

Update to latest version of MSC2946 API s/next_token/next_batch/

This commit is contained in:
Michael Telatynski
2021-08-11 20:49:23 +01:00
parent 88b8b24629
commit db212a555d
2 changed files with 6 additions and 6 deletions

View File

@@ -31,7 +31,7 @@ export class RoomHierarchy {
// Map from room id to object
public readonly roomMap = new Map<string, IHierarchyRoom>();
private loadRequest: ReturnType<MatrixClient["getRoomHierarchy"]>;
private nextToken?: string;
private nextBatch?: string;
private _rooms?: IHierarchyRoom[];
private serverSupportError?: Error;
@@ -71,7 +71,7 @@ export class RoomHierarchy {
}
public get canLoadMore(): boolean {
return !!this.serverSupportError || !!this.nextToken || !this._rooms;
return !!this.serverSupportError || !!this.nextBatch || !this._rooms;
}
public get rooms(): IHierarchyRoom[] {
@@ -86,12 +86,12 @@ export class RoomHierarchy {
pageSize,
this.maxDepth,
this.suggestedOnly,
this.nextToken,
this.nextBatch,
);
let rooms: IHierarchyRoom[];
try {
({ rooms, next_token: this.nextToken } = await this.loadRequest);
({ rooms, next_batch: this.nextBatch } = await this.loadRequest);
} catch (e) {
if (e.errcode === "M_UNRECOGNIZED") {
this.serverSupportError = e;