You've already forked matrix-js-sdk
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user