From 082cdba78d86d7239a8aa786919099380ec2488f Mon Sep 17 00:00:00 2001 From: Pedro Beschorner Marin Date: Mon, 5 Apr 2021 13:18:45 -0300 Subject: [PATCH 1/2] Add offline property to user's own status --- .../imports/ui/components/connection-status/service.js | 1 + 1 file changed, 1 insertion(+) diff --git a/bigbluebutton-html5/imports/ui/components/connection-status/service.js b/bigbluebutton-html5/imports/ui/components/connection-status/service.js index c5311b252c..3fd7efbe35 100644 --- a/bigbluebutton-html5/imports/ui/components/connection-status/service.js +++ b/bigbluebutton-html5/imports/ui/components/connection-status/service.js @@ -175,6 +175,7 @@ const getMyConnectionStatus = () => { return [{ name: Auth.fullname, avatar: me.avatar, + offline: false, you: true, moderator: false, color: me.color, From 99690b55ecbaf6a47642dcb01e4a95777d14232e Mon Sep 17 00:00:00 2001 From: Pedro Beschorner Marin Date: Mon, 5 Apr 2021 13:19:24 -0300 Subject: [PATCH 2/2] Extra connection's status sorting Push offline users to the bottom of the list. --- .../imports/ui/components/connection-status/service.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bigbluebutton-html5/imports/ui/components/connection-status/service.js b/bigbluebutton-html5/imports/ui/components/connection-status/service.js index 3fd7efbe35..4df10074e0 100644 --- a/bigbluebutton-html5/imports/ui/components/connection-status/service.js +++ b/bigbluebutton-html5/imports/ui/components/connection-status/service.js @@ -142,6 +142,12 @@ const sortLevel = (a, b) => { if (indexOfA > indexOfB) return -1; }; +const sortOffline = (a, b) => { + if (a.offline && !b.offline) return 1; + if (a.offline === b.offline) return 0; + if (!a.offline && b.offline) return -1; +}; + const getMyConnectionStatus = () => { const myConnectionStatus = ConnectionStatus.findOne( { @@ -245,7 +251,7 @@ const getConnectionStatus = () => { } return result; - }, []).sort(sortLevel); + }, []).sort(sortLevel).sort(sortOffline); }; const isEnabled = () => STATS.enabled;