mirror of
https://github.com/oxen-io/session-desktop.git
synced 2023-12-14 02:12:57 +01:00
fix order of added new group in leftPane
This commit is contained in:
parent
3b3378a2ee
commit
ebd94ce15c
2 changed files with 15 additions and 11 deletions
|
@ -196,16 +196,19 @@ async function handleNewClosedGroup(
|
|||
'incoming'
|
||||
);
|
||||
|
||||
convo.set('name', name);
|
||||
convo.set('members', members);
|
||||
// mark a closed group as a medium group.
|
||||
// this field is used to poll for this groupPubKey on the swarm nodes, among other things
|
||||
convo.set('is_medium_group', true);
|
||||
convo.set('active_at', Date.now());
|
||||
convo.set('lastJoinedTimestamp', Date.now());
|
||||
|
||||
// We only set group admins on group creation
|
||||
convo.set('groupAdmins', admins);
|
||||
const groupDetails = {
|
||||
id: groupId,
|
||||
name: name,
|
||||
members: members,
|
||||
admins,
|
||||
active: true,
|
||||
};
|
||||
|
||||
// be sure to call this before sending the message.
|
||||
// the sending pipeline needs to know from GroupUtils when a message is for a medium group
|
||||
await ClosedGroup.updateOrCreateClosedGroup(groupDetails);
|
||||
|
||||
await convo.commit();
|
||||
// sanity checks validate this
|
||||
// tslint:disable: no-non-null-assertion
|
||||
|
@ -732,8 +735,6 @@ export async function createClosedGroup(
|
|||
// be sure to call this before sending the message.
|
||||
// the sending pipeline needs to know from GroupUtils when a message is for a medium group
|
||||
await ClosedGroup.updateOrCreateClosedGroup(groupDetails);
|
||||
convo.set('lastJoinedTimestamp', Date.now());
|
||||
convo.set('active_at', Date.now());
|
||||
await convo.commit();
|
||||
convo.updateLastMessage();
|
||||
|
||||
|
|
|
@ -258,8 +258,11 @@ export async function updateOrCreateClosedGroup(details: GroupInfo) {
|
|||
// activeAt is null, then this group has been purposefully hidden.
|
||||
if (activeAt !== null) {
|
||||
updates.active_at = activeAt || Date.now();
|
||||
updates.timestamp = updates.active_at;
|
||||
}
|
||||
updates.left = false;
|
||||
updates.lastJoinedTimestamp = updates.active_at;
|
||||
|
||||
} else {
|
||||
updates.left = true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue