diff options
author | DorraJaouad <dorra.jaoued7@gmail.com> | 2024-07-05 14:14:03 +0200 |
---|---|---|
committer | DorraJaouad <dorra.jaoued7@gmail.com> | 2024-07-06 12:01:41 +0200 |
commit | e0436772de914b4e3f2ff3ac5f887e4d9f9d2324 (patch) | |
tree | fc610fa2b503eddb30333a20efd2542098c888e5 | |
parent | 5f3b216a5828efa992b4761ca66e24840c314e91 (diff) |
Fix: reorganize conditions
Signed-off-by: DorraJaouad <dorra.jaoued7@gmail.com>
-rw-r--r-- | src/components/MessagesList/MessagesGroup/MessagesSystemGroup.vue | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/components/MessagesList/MessagesGroup/MessagesSystemGroup.vue b/src/components/MessagesList/MessagesGroup/MessagesSystemGroup.vue index 120444211..d794d2cb3 100644 --- a/src/components/MessagesList/MessagesGroup/MessagesSystemGroup.vue +++ b/src/components/MessagesList/MessagesGroup/MessagesSystemGroup.vue @@ -133,21 +133,21 @@ export default { return '' // No previous message } - if (message1.actorId !== message2.actorId - || message1.actorType !== message2.actorType) { - return '' // Different actors + // Group users joined call + if (message1.systemMessage === 'call_joined' + && message1.systemMessage === message2.systemMessage) { + return 'call_joined' } - // Group users added by one actor - if (message1.systemMessage === 'user_added' + // Group users left call + if (message1.systemMessage === 'call_left' && message1.systemMessage === message2.systemMessage) { - return 'user_added' + return 'call_left' } - // Group users removed by one actor - if (message1.systemMessage === 'user_removed' - && message1.systemMessage === message2.systemMessage) { - return 'user_removed' + if (message1.actorId !== message2.actorId + || message1.actorType !== message2.actorType) { + return '' // Different actors } // Group users reconnected in a minute @@ -157,25 +157,25 @@ export default { return 'call_reconnected' } - // Group users joined call one by one - if (message1.systemMessage === 'call_joined' + // Group users added by one actor + if (message1.systemMessage === 'user_added' && message1.systemMessage === message2.systemMessage) { - return 'call_joined' + return 'user_added' } - // Group users left call one by one - if (message1.systemMessage === 'call_left' + // Group users removed by one actor + if (message1.systemMessage === 'user_removed' && message1.systemMessage === message2.systemMessage) { - return 'call_left' + return 'user_removed' } - // Group users promoted one by one + // Group users promoted by one actor if ((message1.systemMessage === 'moderator_promoted' || message1.systemMessage === 'guest_moderator_promoted') && (message2.systemMessage === 'moderator_promoted' || message2.systemMessage === 'guest_moderator_promoted')) { return 'moderator_promoted' } - // Group users demoted one by one + // Group users demoted by one actor if ((message1.systemMessage === 'moderator_demoted' || message1.systemMessage === 'guest_moderator_demoted') && (message2.systemMessage === 'moderator_demoted' || message2.systemMessage === 'guest_moderator_demoted')) { return 'moderator_demoted' |