mirror of
https://github.com/Roslund/sthlm-mesh.git
synced 2026-10-30 23:41:58 +01:00
sort messages
This commit is contained in:
1 parent
283a7f4f45
commit
6339b66d7b
1 file changed
+3
@@ -37,6 +37,9 @@ document.addEventListener("DOMContentLoaded", async function () {
|
|||||||
new Map(data.text_messages.map(msg => [msg.packet_id, msg])).values()
|
new Map(data.text_messages.map(msg => [msg.packet_id, msg])).values()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Sort the messages, for some reason with multiple mqtt gateways they are unsorted.
|
||||||
|
state.messages.sort((a, b) => new Date(b.created_at) - new Date(a.created_at));
|
||||||
|
|
||||||
// fetch node info
|
// fetch node info
|
||||||
for(const message of state.messages){
|
for(const message of state.messages){
|
||||||
await fetchNodeInfo(message.to);
|
await fetchNodeInfo(message.to);
|
||||||
|
|||||||
Reference in new issue
Block a user