openvidu-node-client: sort active connections by creation time when fetched

pull/121/head
pabloFuente 2018-09-20 12:24:07 +02:00
parent 314460305e
commit 04cf3f3630
1 changed files with 2 additions and 0 deletions

View File

@ -472,6 +472,8 @@ export class Session {
publishers,
subscribers));
});
// Order connections by time of creation
this.activeConnections.sort((c1, c2) => (c1.createdAt > c2.createdAt) ? 1 : ((c2.createdAt > c1.createdAt) ? -1 : 0));
return this;
}