mirror of
https://github.com/element-hq/element-web
synced 2024-10-23 03:05:45 +03:00
Clear outstanding TODOs
This commit is contained in:
parent
b9f86d54c3
commit
a63d9220d2
2 changed files with 11 additions and 8 deletions
|
@ -634,9 +634,16 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
|
||||||
return sortBy(spaces, [this.getSpaceTagOrdering, "roomId"]);
|
return sortBy(spaces, [this.getSpaceTagOrdering, "roomId"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
private setRootSpaceOrder(space: Room, order: string): void {
|
private async setRootSpaceOrder(space: Room, order: string): Promise<void> {
|
||||||
this.spaceOrderLocalEchoMap.set(space.roomId, order);
|
this.spaceOrderLocalEchoMap.set(space.roomId, order);
|
||||||
this.matrixClient.setRoomAccountData(space.roomId, EventType.SpaceOrder, { order }); // TODO retrying, failure
|
try {
|
||||||
|
await this.matrixClient.setRoomAccountData(space.roomId, EventType.SpaceOrder, { order });
|
||||||
|
} catch (e) {
|
||||||
|
console.log("Failed to set root space order", e);
|
||||||
|
if (this.spaceOrderLocalEchoMap.get(space.roomId) === order) {
|
||||||
|
this.spaceOrderLocalEchoMap.delete(space.roomId);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public moveRootSpace(fromIndex: number, toIndex: number): void {
|
public moveRootSpace(fromIndex: number, toIndex: number): void {
|
||||||
|
@ -647,11 +654,7 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
|
||||||
this.setRootSpaceOrder(this.rootSpaces[index], order);
|
this.setRootSpaceOrder(this.rootSpaces[index], order);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (changes.length) {
|
this.notifyIfOrderChanged();
|
||||||
this.notifyIfOrderChanged();
|
|
||||||
} else {
|
|
||||||
// TODO
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ describe("stringOrderField", () => {
|
||||||
expect(baseToString(BigInt(6241))).toEqual("`a");
|
expect(baseToString(BigInt(6241))).toEqual("`a");
|
||||||
expect(baseToString(BigInt(53), "abcdefghijklmnopqrstuvwxyz")).toEqual("ba");
|
expect(baseToString(BigInt(53), "abcdefghijklmnopqrstuvwxyz")).toEqual("ba");
|
||||||
expect(baseToString(BigInt(1234))).toBe("+}");
|
expect(baseToString(BigInt(1234))).toBe("+}");
|
||||||
expect(baseToString(BigInt(0))).toBe(""); // TODO
|
expect(baseToString(BigInt(0))).toBe("");
|
||||||
expect(baseToString(BigInt(1))).toBe(" ");
|
expect(baseToString(BigInt(1))).toBe(" ");
|
||||||
expect(baseToString(BigInt(95))).toBe("~");
|
expect(baseToString(BigInt(95))).toBe("~");
|
||||||
expect(baseToString(BigInt(96))).toBe(" ");
|
expect(baseToString(BigInt(96))).toBe(" ");
|
||||||
|
|
Loading…
Reference in a new issue