diff --git a/ts/receiver/receiver.ts b/ts/receiver/receiver.ts index 911b78516..9cea77c21 100644 --- a/ts/receiver/receiver.ts +++ b/ts/receiver/receiver.ts @@ -14,7 +14,6 @@ import { onError } from './errors'; import { handleContentMessage, innerHandleContentMessage, - isBlocked, onDeliveryReceipt, } from './contentMessage'; import _ from 'lodash'; diff --git a/ts/session/types/ClosedGroup.ts b/ts/session/types/ClosedGroup.ts index 0eddf992b..711cca5af 100644 --- a/ts/session/types/ClosedGroup.ts +++ b/ts/session/types/ClosedGroup.ts @@ -4,6 +4,7 @@ import { PubKey } from '.'; import { UserUtil } from '../../util'; +import { MultiDeviceProtocol } from '../protocols'; enum ClosedGroupType { SMALL, @@ -44,7 +45,12 @@ class ClosedGroup { console.warn(`ClosedGroup create: Cannot create a small group with more than ${window.CONSTANTS.SMALL_GROUP_SIZE_LIMIT} members`); } - const primaryDevice = UserUtil.getCurrentPrimaryDevicePubKey(); + const user = await UserUtil.getCurrentDevicePubKey(); + if (!user) { + return; + } + + const primaryDevice = await MultiDeviceProtocol.getPrimaryDevice(user); const allMembers = [primaryDevice, ...members]; // Create Group Identity diff --git a/ts/util/user.ts b/ts/util/user.ts index bacaefb69..cea991b17 100644 --- a/ts/util/user.ts +++ b/ts/util/user.ts @@ -10,15 +10,6 @@ export async function getCurrentDevicePubKey(): Promise { return item.value.split('.')[0]; } -export async function getCurrentPrimaryDevicePubKey(): Promise { - const item = await getItemById('primaryDevicePubKey'); - if (!item || !item.value) { - return undefined; - } - - return item.value; -} - export async function getIdentityKeyPair(): Promise { const item = await getItemById('identityKey');