mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
log actual timestamps as well
so we can see if they are anything but null or a number
This commit is contained in:
parent
4b682ad930
commit
9e891c3442
@ -59,7 +59,7 @@ export class RoomTileViewModel extends ViewModel {
|
|||||||
|
|
||||||
let buf = "";
|
let buf = "";
|
||||||
function log(...args) {
|
function log(...args) {
|
||||||
buf = buf + args.join(" ") + "\n";
|
buf = buf + args.map(a => a+"").join(" ") + "\n";
|
||||||
}
|
}
|
||||||
function logResult(result) {
|
function logResult(result) {
|
||||||
if (result === 0) {
|
if (result === 0) {
|
||||||
@ -86,7 +86,7 @@ export class RoomTileViewModel extends ViewModel {
|
|||||||
const theirTimestampValid = Number.isSafeInteger(theirTimestamp);
|
const theirTimestampValid = Number.isSafeInteger(theirTimestamp);
|
||||||
// if either does not have a timestamp, put the one with a timestamp first
|
// if either does not have a timestamp, put the one with a timestamp first
|
||||||
if (myTimestampValid !== theirTimestampValid) {
|
if (myTimestampValid !== theirTimestampValid) {
|
||||||
log("checking if either does not have lastMessageTimestamp ...");
|
log("checking if either does not have lastMessageTimestamp ...", myTimestamp, theirTimestamp);
|
||||||
if (theirTimestamp === null) {
|
if (theirTimestamp === null) {
|
||||||
return logResult(-1);
|
return logResult(-1);
|
||||||
}
|
}
|
||||||
@ -94,7 +94,7 @@ export class RoomTileViewModel extends ViewModel {
|
|||||||
}
|
}
|
||||||
const timeDiff = theirTimestamp - myTimestamp;
|
const timeDiff = theirTimestamp - myTimestamp;
|
||||||
if (timeDiff === 0 || !theirTimestampValid || !myTimestampValid) {
|
if (timeDiff === 0 || !theirTimestampValid || !myTimestampValid) {
|
||||||
log("checking name ...");
|
log("checking name ...", myTimestamp, theirTimestamp);
|
||||||
// sort alphabetically
|
// sort alphabetically
|
||||||
const nameCmp = this.name.localeCompare(other.name);
|
const nameCmp = this.name.localeCompare(other.name);
|
||||||
if (nameCmp === 0) {
|
if (nameCmp === 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user