compare(): Add checks for 'ph-123' room IDs
These will be used to place placeholders correctly.
This commit is contained in:
parent
7dc8648fec
commit
4f7468a95a
1 changed files with 8 additions and 2 deletions
|
@ -159,8 +159,14 @@ export class Sync3 {
|
||||||
if (roomIdA === roomIdB) {
|
if (roomIdA === roomIdB) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
const indexA = this.roomIdToRoomIndex[roomIdA];
|
let indexA = this.roomIdToRoomIndex[roomIdA];
|
||||||
const indexB = this.roomIdToRoomIndex[roomIdB];
|
let indexB = this.roomIdToRoomIndex[roomIdB];
|
||||||
|
if (indexA === undefined && roomIdA.startsWith("ph-")) {
|
||||||
|
indexA = Number(roomIdA.substr(3));
|
||||||
|
}
|
||||||
|
if (indexB === undefined && roomIdB.startsWith("ph-")) {
|
||||||
|
indexB = Number(roomIdB.substr(3));
|
||||||
|
}
|
||||||
if (indexA === undefined || indexB === undefined) {
|
if (indexA === undefined || indexB === undefined) {
|
||||||
console.error("sync3 cannot compare: missing indices for rooms", roomIdA, roomIdB, indexA, indexB);
|
console.error("sync3 cannot compare: missing indices for rooms", roomIdA, roomIdB, indexA, indexB);
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue