mirror of
https://github.com/oxen-io/session-desktop.git
synced 2023-12-14 02:12:57 +01:00
fix empty avatar being undefined rather than ''
building ClosedGroupUpdate message via ts makes it have an avatar content with fields empty if we pass '' as avatar. we wamt no avatar field at all
This commit is contained in:
parent
9be0dcabd9
commit
a4fedaf75d
|
@ -700,7 +700,7 @@
|
|||
return;
|
||||
}
|
||||
|
||||
const nullAvatar = '';
|
||||
const nullAvatar = undefined;
|
||||
if (avatar) {
|
||||
// would get to download this file on each client in the group
|
||||
// and reference the local file
|
||||
|
@ -831,7 +831,7 @@
|
|||
recipients: allMembers,
|
||||
active: true,
|
||||
expireTimer: 0,
|
||||
avatar: '',
|
||||
avatar: undefined,
|
||||
},
|
||||
confirm: () => {},
|
||||
};
|
||||
|
|
|
@ -43,6 +43,13 @@ export abstract class ClosedGroupUpdateMessage extends ClosedGroupMessage {
|
|||
throw new Error('admins has not the correct type');
|
||||
}
|
||||
|
||||
if (
|
||||
params.avatar !== undefined &&
|
||||
!(params.avatar instanceof SignalService.AttachmentPointer)
|
||||
) {
|
||||
throw new Error('avatar has not the correct type');
|
||||
}
|
||||
|
||||
this.name = params.name;
|
||||
this.members = params.members;
|
||||
this.admins = params.admins;
|
||||
|
|
Loading…
Reference in a new issue