Clean up imports

pull/1204/head
Maxim Shishmarev 5 years ago
parent 0904e7a8ca
commit 6295e4206d

@ -1,4 +1,5 @@
import { MessageModel } from '../../js/models/messages'; import { MessageModel } from '../../js/models/messages';
import _ from 'lodash';
import * as Data from '../../js/modules/data'; import * as Data from '../../js/modules/data';
@ -6,8 +7,6 @@ import * as Data from '../../js/modules/data';
let webAPI: any; let webAPI: any;
export async function downloadAttachment(attachment: any) { export async function downloadAttachment(attachment: any) {
const _ = window.Lodash;
if (!webAPI) { if (!webAPI) {
webAPI = window.WebAPI.connect(); webAPI = window.WebAPI.connect();
} }
@ -204,7 +203,6 @@ async function processGroupAvatar(message: MessageModel): Promise<boolean> {
export async function queueAttachmentDownloads( export async function queueAttachmentDownloads(
message: MessageModel message: MessageModel
): Promise<boolean> { ): Promise<boolean> {
const _ = window.Lodash;
const { Whisper } = window; const { Whisper } = window;
let count = 0; let count = 0;

@ -8,6 +8,8 @@ import { toNumber } from 'lodash';
import * as libsession from '../session'; import * as libsession from '../session';
import { handleSessionRequestMessage } from './sessionHandling'; import { handleSessionRequestMessage } from './sessionHandling';
import { handlePairingAuthorisationMessage } from './multidevice'; import { handlePairingAuthorisationMessage } from './multidevice';
import { MediumGroupRequestKeysMessage } from '../session/messages/outgoing';
import { MultiDeviceProtocol } from '../session/protocols';
import { handleSyncMessage } from './syncMessages'; import { handleSyncMessage } from './syncMessages';
import { onError } from './errors'; import { onError } from './errors';
@ -288,9 +290,7 @@ async function decrypt(envelope: EnvelopePlus, ciphertext: any): Promise<any> {
groupId, groupId,
}; };
const requestKeysMessage = new libsession.Messages.Outgoing.MediumGroupRequestKeysMessage( const requestKeysMessage = new MediumGroupRequestKeysMessage(params);
params
);
const senderPubKey = new libsession.Types.PubKey(senderIdentity); const senderPubKey = new libsession.Types.PubKey(senderIdentity);
// tslint:disable-next-line no-floating-promises // tslint:disable-next-line no-floating-promises
libsession.getMessageQueue().send(senderPubKey, requestKeysMessage); libsession.getMessageQueue().send(senderPubKey, requestKeysMessage);
@ -494,7 +494,7 @@ async function handleTypingMessage(
// Groups don't have primary devices so we need to take that into consideration. // Groups don't have primary devices so we need to take that into consideration.
const user = libsession.Types.PubKey.from(source); const user = libsession.Types.PubKey.from(source);
const primaryDevice = user const primaryDevice = user
? await libsession.Protocols.MultiDeviceProtocol.getPrimaryDevice(user) ? await MultiDeviceProtocol.getPrimaryDevice(user)
: null; : null;
const convoId = groupId || (primaryDevice && primaryDevice.key) || source; const convoId = groupId || (primaryDevice && primaryDevice.key) || source;

@ -1,6 +1,5 @@
import { SignalService } from './../protobuf'; import { SignalService } from './../protobuf';
import { addToCache, removeFromCache } from './cache'; import { removeFromCache } from './cache';
import { toNumber } from 'lodash';
import { MultiDeviceProtocol } from '../session/protocols'; import { MultiDeviceProtocol } from '../session/protocols';
import { EnvelopePlus } from './types'; import { EnvelopePlus } from './types';
import { ConversationType, getEnvelopeId } from './common'; import { ConversationType, getEnvelopeId } from './common';
@ -13,6 +12,7 @@ import { handleEndSession } from './sessionHandling';
import { handleMediumGroupUpdate } from './mediumGroups'; import { handleMediumGroupUpdate } from './mediumGroups';
import { handleUnpairRequest } from './multidevice'; import { handleUnpairRequest } from './multidevice';
import { downloadAttachment } from './attachments'; import { downloadAttachment } from './attachments';
import _ from 'lodash';
export async function updateProfile( export async function updateProfile(
conversation: any, conversation: any,
@ -79,7 +79,7 @@ export async function updateProfile(
function cleanAttachment(attachment: any) { function cleanAttachment(attachment: any) {
return { return {
...window.Lodash.omit(attachment, 'thumbnail'), ..._.omit(attachment, 'thumbnail'),
id: attachment.id.toString(), id: attachment.id.toString(),
key: attachment.key ? attachment.key.toString('base64') : null, key: attachment.key ? attachment.key.toString('base64') : null,
digest: attachment.digest ? attachment.digest.toString('base64') : null, digest: attachment.digest ? attachment.digest.toString('base64') : null,
@ -129,7 +129,7 @@ function cleanAttachments(decrypted: any) {
if (quote) { if (quote) {
if (quote.id) { if (quote.id) {
quote.id = toNumber(quote.id); quote.id = _.toNumber(quote.id);
} }
quote.attachments = (quote.attachments || []).map((item: any) => { quote.attachments = (quote.attachments || []).map((item: any) => {
@ -227,8 +227,6 @@ export async function processDecrypted(envelope: EnvelopePlus, decrypted: any) {
} }
function isMessageEmpty(message: SignalService.DataMessage) { function isMessageEmpty(message: SignalService.DataMessage) {
const { Lodash: _ } = window;
const { const {
flags, flags,
body, body,
@ -261,14 +259,14 @@ export async function handleDataMessage(
window.log.info('data message from', getEnvelopeId(envelope)); window.log.info('data message from', getEnvelopeId(envelope));
if (dataMessage.mediumGroupUpdate) { if (dataMessage.mediumGroupUpdate) {
handleMediumGroupUpdate(envelope, dataMessage.mediumGroupUpdate).ignore(); await handleMediumGroupUpdate(envelope, dataMessage.mediumGroupUpdate);
// TODO: investigate the meaning of this return value
return; return;
} }
// tslint:disable-next-line no-bitwise // tslint:disable-next-line no-bitwise
if (dataMessage.flags & SignalService.DataMessage.Flags.END_SESSION) { if (dataMessage.flags & SignalService.DataMessage.Flags.END_SESSION) {
await handleEndSession(envelope.source); await handleEndSession(envelope.source);
return;
} }
const message = await processDecrypted(envelope, dataMessage); const message = await processDecrypted(envelope, dataMessage);
const ourPubKey = window.textsecure.storage.user.getNumber(); const ourPubKey = window.textsecure.storage.user.getNumber();
@ -277,7 +275,6 @@ export async function handleDataMessage(
const conversation = window.ConversationController.get(senderPubKey); const conversation = window.ConversationController.get(senderPubKey);
const { UNPAIRING_REQUEST } = SignalService.DataMessage.Flags; const { UNPAIRING_REQUEST } = SignalService.DataMessage.Flags;
const { SESSION_REQUEST } = SignalService.Envelope.Type;
// eslint-disable-next-line no-bitwise // eslint-disable-next-line no-bitwise
const isUnpairingRequest = Boolean(message.flags & UNPAIRING_REQUEST); const isUnpairingRequest = Boolean(message.flags & UNPAIRING_REQUEST);
@ -328,7 +325,7 @@ export async function handleDataMessage(
ev.data = { ev.data = {
source, source,
sourceDevice: envelope.sourceDevice, sourceDevice: envelope.sourceDevice,
timestamp: toNumber(envelope.timestamp), timestamp: _.toNumber(envelope.timestamp),
receivedAt: envelope.receivedAt, receivedAt: envelope.receivedAt,
unidentifiedDeliveryReceived: envelope.unidentifiedDeliveryReceived, unidentifiedDeliveryReceived: envelope.unidentifiedDeliveryReceived,
message, message,
@ -451,8 +448,6 @@ export function initIncomingMessage(data: MessageCreationData): MessageModel {
} }
function createSentMessage(data: MessageCreationData): MessageModel { function createSentMessage(data: MessageCreationData): MessageModel {
const { Lodash: _ } = window;
const now = Date.now(); const now = Date.now();
let sentTo = []; let sentTo = [];
@ -652,8 +647,7 @@ export async function handleMessageEvent(event: any): Promise<void> {
ourNumber, ourNumber,
confirm, confirm,
source, source,
isGroupMessage, primarySource
primarySource.key
).ignore(); ).ignore();
}); });
} }

@ -2,8 +2,7 @@ import { SignalService } from '../protobuf';
import { ClosedGroupRequestInfoMessage } from '../session/messages/outgoing/content/data/group/ClosedGroupRequestInfoMessage'; import { ClosedGroupRequestInfoMessage } from '../session/messages/outgoing/content/data/group/ClosedGroupRequestInfoMessage';
import { getMessageQueue } from '../session'; import { getMessageQueue } from '../session';
import { PubKey } from '../session/types'; import { PubKey } from '../session/types';
import _ from 'lodash';
const _ = window.Lodash;
function isGroupBlocked(groupId: string) { function isGroupBlocked(groupId: string) {
return ( return (

@ -9,6 +9,7 @@ import { updateProfile } from './receiver';
import { onVerified } from './syncMessages'; import { onVerified } from './syncMessages';
import { StringUtils } from '../session/utils'; import { StringUtils } from '../session/utils';
import { MultiDeviceProtocol, SessionProtocol } from '../session/protocols';
async function unpairingRequestIsLegit(source: string, ourPubKey: string) { async function unpairingRequestIsLegit(source: string, ourPubKey: string) {
const { textsecure, storage, lokiFileServerAPI } = window; const { textsecure, storage, lokiFileServerAPI } = window;
@ -110,7 +111,7 @@ async function handlePairingRequest(
if (valid) { if (valid) {
// Pairing dialog is open and is listening // Pairing dialog is open and is listening
if (Whisper.events.isListenedTo('devicePairingRequestReceived')) { if (Whisper.events.isListenedTo('devicePairingRequestReceived')) {
await libsession.Protocols.MultiDeviceProtocol.savePairingAuthorisation( await MultiDeviceProtocol.savePairingAuthorisation(
pairingRequest as Data.PairingAuthorisation pairingRequest as Data.PairingAuthorisation
); );
Whisper.events.trigger( Whisper.events.trigger(
@ -162,7 +163,7 @@ async function handleAuthorisationForSelf(
window.storage.remove('secondaryDeviceStatus'); window.storage.remove('secondaryDeviceStatus');
window.storage.put('isSecondaryDevice', true); window.storage.put('isSecondaryDevice', true);
window.storage.put('primaryDevicePubKey', primaryDevicePubKey); window.storage.put('primaryDevicePubKey', primaryDevicePubKey);
await libsession.Protocols.MultiDeviceProtocol.savePairingAuthorisation( await MultiDeviceProtocol.savePairingAuthorisation(
pairingAuthorisation as Data.PairingAuthorisation pairingAuthorisation as Data.PairingAuthorisation
); );
const primaryConversation = await ConversationController.getOrCreateAndWait( const primaryConversation = await ConversationController.getOrCreateAndWait(
@ -338,7 +339,7 @@ async function onContactReceived(details: any) {
} }
const ourPrimaryKey = window.storage.get('primaryDevicePubKey'); const ourPrimaryKey = window.storage.get('primaryDevicePubKey');
if (ourPrimaryKey) { if (ourPrimaryKey) {
const secondaryDevices = await libsession.Protocols.MultiDeviceProtocol.getSecondaryDevices( const secondaryDevices = await MultiDeviceProtocol.getSecondaryDevices(
ourPrimaryKey ourPrimaryKey
); );
if (secondaryDevices.some(device => device.key === id)) { if (secondaryDevices.some(device => device.key === id)) {
@ -346,9 +347,7 @@ async function onContactReceived(details: any) {
} }
} }
const devices = await libsession.Protocols.MultiDeviceProtocol.getAllDevices( const devices = await MultiDeviceProtocol.getAllDevices(id);
id
);
const deviceConversations = await Promise.all( const deviceConversations = await Promise.all(
devices.map(d => devices.map(d =>
ConversationController.getOrCreateAndWait(d.key, 'private') ConversationController.getOrCreateAndWait(d.key, 'private')
@ -358,7 +357,7 @@ async function onContactReceived(details: any) {
// when we do not have a session with it already // when we do not have a session with it already
deviceConversations.forEach(device => { deviceConversations.forEach(device => {
// tslint:disable-next-line: no-floating-promises // tslint:disable-next-line: no-floating-promises
libsession.Protocols.SessionProtocol.sendSessionRequestIfNeeded( SessionProtocol.sendSessionRequestIfNeeded(
new libsession.Types.PubKey(device.id) new libsession.Types.PubKey(device.id)
); );
}); });

@ -3,13 +3,15 @@ import { queueAttachmentDownloads } from './attachments';
import { Quote } from './types'; import { Quote } from './types';
import { ConversationModel } from '../../js/models/conversations'; import { ConversationModel } from '../../js/models/conversations';
import { MessageModel } from '../../js/models/messages'; import { MessageModel } from '../../js/models/messages';
import { PrimaryPubKey, PubKey } from '../session/types';
import _ from 'lodash';
import { MultiDeviceProtocol } from '../session/protocols';
async function handleGroups( async function handleGroups(
conversation: ConversationModel, conversation: ConversationModel,
group: any, group: any,
source: any source: any
): Promise<any> { ): Promise<any> {
const _ = window.Lodash;
const textsecure = window.textsecure; const textsecure = window.textsecure;
const GROUP_TYPES = textsecure.protobuf.GroupContext.Type; const GROUP_TYPES = textsecure.protobuf.GroupContext.Type;
@ -93,7 +95,6 @@ async function copyFromQuotedMessage(
quote: Quote, quote: Quote,
attemptCount: number = 1 attemptCount: number = 1
): Promise<void> { ): Promise<void> {
const _ = window.Lodash;
const { Whisper, MessageController } = window; const { Whisper, MessageController } = window;
const { upgradeMessageSchema } = window.Signal.Migrations; const { upgradeMessageSchema } = window.Signal.Migrations;
const { Message: TypedMessage, Errors } = window.Signal.Types; const { Message: TypedMessage, Errors } = window.Signal.Types;
@ -277,10 +278,10 @@ function processProfileKey(
function handleMentions( function handleMentions(
message: MessageModel, message: MessageModel,
conversation: ConversationModel, conversation: ConversationModel,
ourPrimaryNumber: string ourPrimaryNumber: PrimaryPubKey
) { ) {
const body = message.get('body'); const body = message.get('body');
if (body && body.indexOf(`@${ourPrimaryNumber}`) !== -1) { if (body && body.indexOf(`@${ourPrimaryNumber.key}`) !== -1) {
conversation.set({ mentionedUs: true }); conversation.set({ mentionedUs: true });
} }
} }
@ -317,8 +318,6 @@ function handleSyncedReceipts(
message: MessageModel, message: MessageModel,
conversation: ConversationModel conversation: ConversationModel
) { ) {
const _ = window.Lodash;
const readReceipts = window.Whisper.ReadReceipts.forMessage( const readReceipts = window.Whisper.ReadReceipts.forMessage(
conversation, conversation,
message message
@ -352,8 +351,6 @@ function handleSyncedReceipts(
} }
function handleSyncDeliveryReceipts(message: MessageModel, receipts: any) { function handleSyncDeliveryReceipts(message: MessageModel, receipts: any) {
const _ = window.Lodash;
const sources = receipts.map((receipt: any) => receipt.get('source')); const sources = receipts.map((receipt: any) => receipt.get('source'));
const deliveredTo = _.union(message.get('delivered_to') || [], sources); const deliveredTo = _.union(message.get('delivered_to') || [], sources);
@ -371,11 +368,9 @@ async function handleRegularMessage(
message: MessageModel, message: MessageModel,
initialMessage: any, initialMessage: any,
source: string, source: string,
isGroupMessage: boolean,
ourNumber: any, ourNumber: any,
primarySource: any primarySource: PubKey
) { ) {
const _ = window.Lodash;
const { ConversationController } = window; const { ConversationController } = window;
const { upgradeMessageSchema } = window.Signal.Migrations; const { upgradeMessageSchema } = window.Signal.Migrations;
@ -429,7 +424,9 @@ async function handleRegularMessage(
// Handle expireTimer found directly as part of a regular message // Handle expireTimer found directly as part of a regular message
handleExpireTimer(source, message, dataMessage.expireTimer, conversation); handleExpireTimer(source, message, dataMessage.expireTimer, conversation);
handleMentions(message, conversation, ourNumber); const ourPrimary = await MultiDeviceProtocol.getPrimaryDevice(ourNumber);
handleMentions(message, conversation, ourPrimary);
if (type === 'incoming') { if (type === 'incoming') {
updateReadStatus(message, conversation); updateReadStatus(message, conversation);
@ -465,7 +462,7 @@ async function handleRegularMessage(
} }
if (source !== ourNumber && primarySource) { if (source !== ourNumber && primarySource) {
message.set({ source: primarySource }); message.set({ source: primarySource.key });
} }
} }
@ -506,10 +503,9 @@ export async function handleMessageJob(
conversation: ConversationModel, conversation: ConversationModel,
initialMessage: any, initialMessage: any,
ourNumber: string, ourNumber: string,
confirm: any, confirm: () => void,
source: string, source: string,
isGroupMessage: any, primarySource: PubKey
primarySource: any
) { ) {
window.log.info( window.log.info(
`Starting handleDataMessage for message ${message.idForLogging()} in conversation ${conversation.idForLogging()}` `Starting handleDataMessage for message ${message.idForLogging()} in conversation ${conversation.idForLogging()}`
@ -529,13 +525,12 @@ export async function handleMessageJob(
message, message,
initialMessage, initialMessage,
source, source,
isGroupMessage,
ourNumber, ourNumber,
primarySource.key primarySource
); );
} }
const { Whisper, MessageController, ConversationController } = window; const { Whisper, MessageController } = window;
const id = await window.Signal.Data.saveMessage(message.attributes, { const id = await window.Signal.Data.saveMessage(message.attributes, {
Message: Whisper.Message, Message: Whisper.Message,

@ -1,9 +1,8 @@
import { EnvelopePlus } from './types'; import { EnvelopePlus } from './types';
import { SignalService } from '../protobuf'; import { SignalService } from '../protobuf';
import * as libsession from './../session';
import { removeFromCache } from './cache'; import { removeFromCache } from './cache';
import { getEnvelopeId } from './common'; import { getEnvelopeId } from './common';
import { toNumber } from 'lodash'; import _ from 'lodash';
import { handleEndSession } from './sessionHandling'; import { handleEndSession } from './sessionHandling';
import { handleMediumGroupUpdate } from './mediumGroups'; import { handleMediumGroupUpdate } from './mediumGroups';
@ -11,6 +10,7 @@ import { handleMessageEvent, processDecrypted } from './dataMessage';
import { updateProfile } from './receiver'; import { updateProfile } from './receiver';
import { handleContacts } from './multidevice'; import { handleContacts } from './multidevice';
import { onGroupReceived } from './groups'; import { onGroupReceived } from './groups';
import { MultiDeviceProtocol } from '../session/protocols';
export async function handleSyncMessage( export async function handleSyncMessage(
envelope: EnvelopePlus, envelope: EnvelopePlus,
@ -20,9 +20,7 @@ export async function handleSyncMessage(
// We should only accept sync messages from our devices // We should only accept sync messages from our devices
const ourNumber = textsecure.storage.user.getNumber(); const ourNumber = textsecure.storage.user.getNumber();
const ourDevices = await libsession.Protocols.MultiDeviceProtocol.getAllDevices( const ourDevices = await MultiDeviceProtocol.getAllDevices(ourNumber);
ourNumber
);
const validSyncSender = ourDevices.some( const validSyncSender = ourDevices.some(
device => device.key === envelope.source device => device.key === envelope.source
); );
@ -42,7 +40,7 @@ export async function handleSyncMessage(
window.log.info( window.log.info(
'sent message to', 'sent message to',
to, to,
toNumber(sentMessage.timestamp), _.toNumber(sentMessage.timestamp),
'from', 'from',
getEnvelopeId(envelope) getEnvelopeId(envelope)
); );
@ -117,13 +115,13 @@ async function handleSentMessage(
ev.confirm = removeFromCache.bind(null, envelope); ev.confirm = removeFromCache.bind(null, envelope);
ev.data = { ev.data = {
destination, destination,
timestamp: toNumber(timestamp), timestamp: _.toNumber(timestamp),
device: envelope.sourceDevice, device: envelope.sourceDevice,
unidentifiedStatus, unidentifiedStatus,
message, message,
}; };
if (expirationStartTimestamp) { if (expirationStartTimestamp) {
ev.data.expirationStartTimestamp = toNumber(expirationStartTimestamp); ev.data.expirationStartTimestamp = _.toNumber(expirationStartTimestamp);
} }
await handleMessageEvent(ev); await handleMessageEvent(ev);
@ -158,7 +156,7 @@ async function handleBlocked(
window.log.info('Setting these numbers as blocked:', blocked.numbers); window.log.info('Setting these numbers as blocked:', blocked.numbers);
window.textsecure.storage.put('blocked', blocked.numbers); window.textsecure.storage.put('blocked', blocked.numbers);
const groupIds = window.Lodash.map(blocked.groupIds, (groupId: any) => const groupIds = _.map(blocked.groupIds, (groupId: any) =>
groupId.toBinary() groupId.toBinary()
); );
window.log.info( window.log.info(
@ -189,9 +187,9 @@ async function handleRead(
const results = []; const results = [];
for (const read of readArray) { for (const read of readArray) {
const promise = onReadSync( const promise = onReadSync(
toNumber(envelope.timestamp), _.toNumber(envelope.timestamp),
read.sender, read.sender,
toNumber(read.timestamp) _.toNumber(read.timestamp)
); );
results.push(promise); results.push(promise);
} }

@ -4,6 +4,7 @@ import https from 'https';
import * as SnodePool from './snodePool'; import * as SnodePool from './snodePool';
import { sleepFor } from '../../../js/modules/loki_primitives'; import { sleepFor } from '../../../js/modules/loki_primitives';
import { SnodeResponse } from './onions'; import { SnodeResponse } from './onions';
import _ from 'lodash';
const snodeHttpsAgent = new https.Agent({ const snodeHttpsAgent = new https.Agent({
rejectUnauthorized: false, rejectUnauthorized: false,
@ -197,7 +198,7 @@ export async function sendToProxy(
targetNode: Snode, targetNode: Snode,
retryNumber: any = 0 retryNumber: any = 0
): Promise<boolean | SnodeResponse> { ): Promise<boolean | SnodeResponse> {
const { log, Lodash: _, StringView, libloki, libsignal } = window; const { log, StringView, libloki, libsignal } = window;
let snodePool = await SnodePool.getRandomSnodePool(); let snodePool = await SnodePool.getRandomSnodePool();
@ -226,7 +227,12 @@ export async function sendToProxy(
_.find(snodePool, { pubkey_ed25519: targetNode.pubkey_ed25519 }) _.find(snodePool, { pubkey_ed25519: targetNode.pubkey_ed25519 })
); );
const randSnode = window.Lodash.sample(snodePoolSafe); const randSnode = _.sample(snodePoolSafe);
if (!randSnode) {
log.error('No snodes left for a proxy request');
return false;
}
// Don't allow arbitrary URLs, only snodes and loki servers // Don't allow arbitrary URLs, only snodes and loki servers
const url = `https://${randSnode.ip}:${randSnode.port}/proxy`; const url = `https://${randSnode.ip}:${randSnode.port}/proxy`;

@ -3,7 +3,7 @@ import { getSnodesFor, Snode } from './snodePool';
import { retrieveNextMessages } from './serviceNodeAPI'; import { retrieveNextMessages } from './serviceNodeAPI';
import { SignalService } from '../../protobuf'; import { SignalService } from '../../protobuf';
import * as Receiver from '../../receiver/receiver'; import * as Receiver from '../../receiver/receiver';
// import { retrieveNextMessages, getSnodesForPubkey } from './serviceNodeAPI'; import _ from 'lodash';
import { StringUtils } from '../../session/utils'; import { StringUtils } from '../../session/utils';
@ -104,8 +104,6 @@ export class SwarmPolling {
} }
private async pollForAllKeys() { private async pollForAllKeys() {
const { Lodash: _ } = window;
const directPromises = this.pubkeys.map(async pk => { const directPromises = this.pubkeys.map(async pk => {
return this.pollOnceForKey(pk); return this.pollOnceForKey(pk);
}); });
@ -170,8 +168,6 @@ export class SwarmPolling {
): Promise<Array<any>> { ): Promise<Array<any>> {
// console.warn('Polling node: ', node.pubkey_ed25519); // console.warn('Polling node: ', node.pubkey_ed25519);
const { Lodash: _ } = window;
const edkey = node.pubkey_ed25519; const edkey = node.pubkey_ed25519;
const pkStr = pubkey.key ? pubkey.key : pubkey; const pkStr = pubkey.key ? pubkey.key : pubkey;
@ -197,8 +193,6 @@ export class SwarmPolling {
} }
private async pollOnceForKey(pubkey: PubKey) { private async pollOnceForKey(pubkey: PubKey) {
const { Lodash: _ } = window;
// NOTE: sometimes pubkey is string, sometimes it is object, so // NOTE: sometimes pubkey is string, sometimes it is object, so
// accept both until this is fixed: // accept both until this is fixed:
const pk = pubkey.key ? pubkey.key : pubkey; const pk = pubkey.key ? pubkey.key : pubkey;

Loading…
Cancel
Save