Fixing linting errors.

pull/2222/head
warrickct 3 years ago
parent 2957c131c0
commit 2258c6da4c

@ -32,6 +32,7 @@ export const ConversationMessageRequestButtons = () => {
} }
} }
} }
// tslint:disable-next-line: no-floating-promises
getIncomingMessages(); getIncomingMessages();
}); });
@ -68,7 +69,7 @@ export const ConversationMessageRequestButtons = () => {
const handleAcceptConversationRequest = async () => { const handleAcceptConversationRequest = async () => {
const { id } = selectedConversation; const { id } = selectedConversation;
const convo = await getConversationController().get(selectedConversation.id); const convo = getConversationController().get(selectedConversation.id);
await convo.setDidApproveMe(true); await convo.setDidApproveMe(true);
await approveConvoAndSendResponse(id, true); await approveConvoAndSendResponse(id, true);
}; };

@ -25,6 +25,7 @@ export const ConversationRequestinfo = () => {
} }
} }
} }
// tslint:disable-next-line: no-floating-promises
getIncomingMessages(); getIncomingMessages();
}); });

@ -33,7 +33,7 @@ async function handleBlockAllRequestsClick(convoRequests: Array<ReduxConversatio
const convoModel = convoController.get(id); const convoModel = convoController.get(id);
if (!convoModel.isBlocked()) { if (!convoModel.isBlocked()) {
await BlockedNumberController.block(id); await BlockedNumberController.block(id);
convoModel.commit(); await convoModel.commit();
} }
await convoModel.setIsApproved(false); await convoModel.setIsApproved(false);

@ -766,7 +766,6 @@ export async function getUnreadCountByConversation(conversationId: string): Prom
* Gets the count of messages for a direction * Gets the count of messages for a direction
* @param conversationId Conversation for messages to retrieve from * @param conversationId Conversation for messages to retrieve from
* @param type outgoing/incoming * @param type outgoing/incoming
* @returns
*/ */
export async function getMessageCountByType( export async function getMessageCountByType(
conversationId: string, conversationId: string,

@ -12,14 +12,14 @@ import { MessageModel } from './message';
import { MessageAttributesOptionals, MessageDirection } from './messageType'; import { MessageAttributesOptionals, MessageDirection } from './messageType';
import autoBind from 'auto-bind'; import autoBind from 'auto-bind';
import { import {
getMessageCountByType,
getLastMessagesByConversation, getLastMessagesByConversation,
getMessageCountByType,
getMessagesByConversation,
getUnreadByConversation, getUnreadByConversation,
getUnreadCountByConversation, getUnreadCountByConversation,
removeMessage as dataRemoveMessage, removeMessage as dataRemoveMessage,
saveMessages, saveMessages,
updateConversation, updateConversation,
getMessagesByConversation,
} from '../../ts/data/data'; } from '../../ts/data/data';
import { toHex } from '../session/utils/String'; import { toHex } from '../session/utils/String';
import { import {
@ -638,11 +638,6 @@ export class ConversationModel extends Backbone.Model<ConversationAttributes> {
} }
} }
if (uploads.body?.includes('unapprove')) {
this.setIsApproved(false);
this.setDidApproveMe(false);
}
if (this.isOpenGroupV2()) { if (this.isOpenGroupV2()) {
const chatMessageOpenGroupV2 = new OpenGroupVisibleMessage(chatMessageParams); const chatMessageOpenGroupV2 = new OpenGroupVisibleMessage(chatMessageParams);
const roomInfos = this.toOpenGroupV2(); const roomInfos = this.toOpenGroupV2();
@ -949,7 +944,7 @@ export class ConversationModel extends Backbone.Model<ConversationAttributes> {
) { ) {
// if there's a message by the other user, they've replied to us which we consider an accepted convo // if there's a message by the other user, they've replied to us which we consider an accepted convo
if (!this.didApproveMe() && this.isPrivate()) { if (!this.didApproveMe() && this.isPrivate()) {
this.setDidApproveMe(true); await this.setDidApproveMe(true);
} }
return this.addSingleMessage({ return this.addSingleMessage({
@ -1396,7 +1391,7 @@ export class ConversationModel extends Backbone.Model<ConversationAttributes> {
); );
}).length === 1; }).length === 1;
const isFirstMessageOfConvo = const isFirstMessageOfConvo =
(await (await getMessagesByConversation(this.id, { messageId: null })).length) === 1; (await getMessagesByConversation(this.id, { messageId: null })).length === 1;
if (hadNoRequestsPrior && isFirstMessageOfConvo) { if (hadNoRequestsPrior && isFirstMessageOfConvo) {
friendRequestText = window.i18n('youHaveANewFriendRequest'); friendRequestText = window.i18n('youHaveANewFriendRequest');
} else { } else {

Loading…
Cancel
Save