From 4c258cc0441d6e1f3f0fb25941ba4a2ef6d7a1bb Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Thu, 12 Dec 2024 12:01:06 +1100 Subject: [PATCH] fix: sort group update changes by member pubkey --- ts/models/groupUpdate.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ts/models/groupUpdate.ts b/ts/models/groupUpdate.ts index e1332aacb..0ff177582 100644 --- a/ts/models/groupUpdate.ts +++ b/ts/models/groupUpdate.ts @@ -2,14 +2,15 @@ import { ConvoHub } from '../session/conversations'; import { UserUtils } from '../session/utils'; import type { LocalizerComponentPropsObject } from '../types/localizer'; -// to remove after merge with groups function usAndXOthers(arr: Array) { const us = UserUtils.getOurPubKeyStrFromCache(); - if (arr.includes(us)) { - return { us: true, others: arr.filter(m => m !== us) }; + const others = arr.filter(m => m !== us).sort(); + + if (others.length !== arr.length) { + return { us: true, others }; } - return { us: false, others: arr }; + return { us: false, others }; } export function getKickedGroupUpdateStr(