Merge pull request #3888 from thelounge/xpaw/id-order

Fix msg id order when loading from sqlite
This commit is contained in:
Pavel Djundik 2020-04-28 21:42:44 +03:00 committed by GitHub
commit fb9e3e6a53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -183,18 +183,16 @@ class MessageStorage {
} }
resolve( resolve(
rows rows.reverse().map((row) => {
.map((row) => { const msg = JSON.parse(row.msg);
const msg = JSON.parse(row.msg); msg.time = row.time;
msg.time = row.time; msg.type = row.type;
msg.type = row.type;
const newMsg = new Msg(msg); const newMsg = new Msg(msg);
newMsg.id = this.client.idMsg++; newMsg.id = this.client.idMsg++;
return newMsg; return newMsg;
}) })
.reverse()
); );
} }
) )