Fixing linting errors

pull/2222/head
warrickct 4 years ago
parent 62945a2910
commit 0db3c76756

@ -17,7 +17,7 @@ export const ConversationMessageRequestButtons = (props: {
const { isApproved, type } = selectedConversation; const { isApproved, type } = selectedConversation;
const showMsgRequestUI = !isApproved && type === 'private'; const showMsgRequestUI = !isApproved && type === 'private';
const handleDeclineConversationRequest = async () => { const handleDeclineConversationRequest = () => {
window.inboxStore?.dispatch( window.inboxStore?.dispatch(
updateConfirmModal({ updateConfirmModal({
okText: window.i18n('decline'), okText: window.i18n('decline'),

@ -131,11 +131,10 @@ export const acceptConversation = async (conversationId: string, syncToDevices:
return; return;
} }
Promise.all([ await convoToApprove.setIsApproved(true, false);
await convoToApprove.setIsApproved(true, false), await convoToApprove.setDidApproveMe(true, false);
await convoToApprove.setDidApproveMe(true, false),
]); await convoToApprove.commit();
convoToApprove.commit();
await convoToApprove.sendMessageRequestResponse(true); await convoToApprove.sendMessageRequestResponse(true);
// Conversation was not approved before so a sync is needed // Conversation was not approved before so a sync is needed

@ -147,7 +147,7 @@ const handleContactReceived = async (
if (contactReceived.didApproveMe) { if (contactReceived.didApproveMe) {
// TODO: add message search in convo for pre-existing msgRequestResponse msg only happens once per convo // TODO: add message search in convo for pre-existing msgRequestResponse msg only happens once per convo
// if source of the sync matches conversationId // if source of the sync matches conversationId
contactConvo.addSingleMessage({ await contactConvo.addSingleMessage({
conversationId: contactConvo.get('id'), conversationId: contactConvo.get('id'),
source: envelope.source, source: envelope.source,
type: 'outgoing', // mark it as outgoing just so it appears below our sent attachment type: 'outgoing', // mark it as outgoing just so it appears below our sent attachment

@ -303,7 +303,7 @@ function shouldDropBlockedUserMessage(content: SignalService.Content): boolean {
// first check that dataMessage is the only field set in the Content // first check that dataMessage is the only field set in the Content
let msgWithoutDataMessage = Lodash.pickBy( let msgWithoutDataMessage = Lodash.pickBy(
content, content,
(_, key) => key !== 'dataMessage' && key !== 'toJSON' (_value, key) => key !== 'dataMessage' && key !== 'toJSON'
); );
msgWithoutDataMessage = Lodash.pickBy(msgWithoutDataMessage, Lodash.identity); msgWithoutDataMessage = Lodash.pickBy(msgWithoutDataMessage, Lodash.identity);
@ -322,6 +322,7 @@ function shouldDropBlockedUserMessage(content: SignalService.Content): boolean {
return !isControlDataMessageOnly; return !isControlDataMessageOnly;
} }
// tslint:disable-next-line: cyclomatic-complexity
export async function innerHandleSwarmContentMessage( export async function innerHandleSwarmContentMessage(
envelope: EnvelopePlus, envelope: EnvelopePlus,
plaintext: ArrayBuffer, plaintext: ArrayBuffer,
@ -386,9 +387,9 @@ export async function innerHandleSwarmContentMessage(
// For edge case when messaging a client that's unable to explicitly send request approvals // For edge case when messaging a client that's unable to explicitly send request approvals
if (!convo.didApproveMe() && convo.isPrivate() && convo.isApproved()) { if (!convo.didApproveMe() && convo.isPrivate() && convo.isApproved()) {
convo.setDidApproveMe(true); await convo.setDidApproveMe(true);
// Conversation was not approved before so a sync is needed // Conversation was not approved before so a sync is needed
convo.addSingleMessage({ await convo.addSingleMessage({
conversationId: convo.get('id'), conversationId: convo.get('id'),
source: envelope.source, source: envelope.source,
type: 'outgoing', // mark it as outgoing just so it appears below our sent attachment type: 'outgoing', // mark it as outgoing just so it appears below our sent attachment
@ -609,7 +610,7 @@ async function handleMessageRequestResponse(
await conversationToApprove.setDidApproveMe(isApproved); await conversationToApprove.setDidApproveMe(isApproved);
if (isApproved === true) { if (isApproved === true) {
// Conversation was not approved before so a sync is needed // Conversation was not approved before so a sync is needed
conversationToApprove.addSingleMessage({ await conversationToApprove.addSingleMessage({
conversationId: conversationToApprove.get('id'), conversationId: conversationToApprove.get('id'),
source: envelope.source, source: envelope.source,
type: 'outgoing', // mark it as outgoing just so it appears below our sent attachment type: 'outgoing', // mark it as outgoing just so it appears below our sent attachment

@ -104,7 +104,7 @@ export class ConfigurationMessageContact {
profileKey, profileKey,
isApproved, isApproved,
isBlocked, isBlocked,
didApproveMe didApproveMe,
}: { }: {
publicKey: string; publicKey: string;
displayName: string; displayName: string;
@ -145,7 +145,7 @@ export class ConfigurationMessageContact {
profileKey: this.profileKey, profileKey: this.profileKey,
isApproved: this.isApproved, isApproved: this.isApproved,
isBlocked: this.isBlocked, isBlocked: this.isBlocked,
didApproveMe: this.didApproveMe didApproveMe: this.didApproveMe,
}); });
} }
} }

@ -96,6 +96,7 @@ export class MockConversation {
isTrustedForAttachmentDownload: false, isTrustedForAttachmentDownload: false,
isPinned: false, isPinned: false,
isApproved: false, isApproved: false,
didApproveMe: false,
}; };
} }

Loading…
Cancel
Save