fix: resolved some yarn ready issues

pull/2660/head
William Grant 2 years ago
parent c3b09578a1
commit e34e3d4a4b

@ -80,6 +80,7 @@ export type ConversationHeaderTitleProps = {
expireTimer?: number;
};
// tslint:disable: cyclomatic-complexity max-func-body-length
export const ConversationHeaderTitle = () => {
const headerTitleProps = useSelector(getConversationHeaderTitleProps);
const notificationSetting = useSelector(getCurrentNotificationSettingText);
@ -111,6 +112,9 @@ export const ConversationHeaderTitle = () => {
const notificationSubtitle = notificationSetting
? i18n('notificationSubtitle', [notificationSetting])
: null;
if (notificationSubtitle) {
subtitles.push(notificationSubtitle);
}
let memberCount = 0;
if (isGroup) {
@ -120,9 +124,6 @@ export const ConversationHeaderTitle = () => {
memberCount = members.length;
}
}
if (notificationSubtitle) {
subtitles.push(notificationSubtitle);
}
let memberCountSubtitle = null;
if (isGroup && memberCount > 0 && !isKickedFromGroup) {
@ -166,6 +167,19 @@ export const ConversationHeaderTitle = () => {
}
};
const handleRightPanelToggle = () => {
if (isRightPanelOn) {
dispatch(closeRightPanel());
} else {
if (visibleTitleIndex === 2) {
dispatch(setRightOverlayMode('disappearing-messages'));
} else {
dispatch(setRightOverlayMode('panel-settings'));
}
dispatch(openRightPanel());
}
};
useEffect(() => {
setVisibleTitleIndex(0);
}, [convoName]);
@ -180,18 +194,7 @@ export const ConversationHeaderTitle = () => {
<div className="module-conversation-header__title-flex">
<div
className="module-conversation-header__title"
onClick={() => {
if (isRightPanelOn) {
dispatch(closeRightPanel());
} else {
if (visibleTitleIndex === 2) {
dispatch(setRightOverlayMode('disappearing-messages'));
} else {
dispatch(setRightOverlayMode('panel-settings'));
}
dispatch(openRightPanel());
}
}}
onClick={handleRightPanelToggle}
role="button"
>
<span

@ -4,7 +4,6 @@ import styled from 'styled-components';
import { setDisappearingMessagesByConvoId } from '../../../../interactions/conversationInteractions';
import { closeRightPanel } from '../../../../state/ducks/conversations';
import { resetRightOverlayMode } from '../../../../state/ducks/section';
import { getSelectedConversationKey } from '../../../../state/selectors/conversations';
import { Flex } from '../../../basic/Flex';
import { SessionButton } from '../../../basic/SessionButton';
import { SpacerLG, SpacerXL } from '../../../basic/Text';
@ -15,6 +14,7 @@ import { SessionIconButton } from '../../../icon';
import {
getSelectedConversationExpirationModes,
getSelectedConversationExpirationSettings,
getSelectedConversationKey,
} from '../../../../state/selectors/conversations';
import { DisappearingMessageConversationType } from '../../../../util/expiringMessages';
import { TimerOptionsArray } from '../../../../state/ducks/timerOptions';

@ -187,7 +187,7 @@ export function useMessageReactsPropsById(messageId?: string) {
// TODO remove 10 seconds timer
export function useTimerOptionsByMode(disappearingMessageMode?: string) {
return useSelector((state: StateType) => {
let options = state.timerOptions.timerOptions;
const options = state.timerOptions.timerOptions;
switch (disappearingMessageMode) {
case 'deleteAfterSend':

@ -1142,7 +1142,7 @@ export class ConversationModel extends Backbone.Model<ConversationAttributes> {
if (this.isMe()) {
// TODO Check that the args are correct
if (expireUpdate.expirationType === 'deleteAfterRead') {
window.log.info(`WIP: Note to Self messages cannot be delete after read!`);
window.log.info('WIP: Note to Self messages cannot be delete after read!');
return;
}

@ -2281,7 +2281,7 @@ function cleanUpOldOpengroupsOnStart() {
})();
}
// tslint:disable: binary-expression-operand-order insecure-random
// tslint:disable: max-func-body-length binary-expression-operand-order insecure-random
/**
* Only using this for development. Populate conversation and message tables.
*/

@ -245,7 +245,7 @@ export async function handleSwarmDataMessage(
if (isSyncedMessage) {
// TODO handle sync messages separately
console.log(`WIP: Sync Message dropping`);
window.log.info('WIP: Sync Message dropping');
} else {
if (msgModel.isIncoming() && expireUpdate.expirationType === 'deleteAfterSend') {
msgModel =

@ -247,6 +247,7 @@ export async function expireMessageOnSnode(messageHash: string, expireTimer: num
let snode: Snode | undefined;
try {
const firstSuccessSnode = await firstTrue(promises);
snode = firstSuccessSnode;
console.log(`WIP: expireMessageOnSnode firstSuccessSnode`, firstSuccessSnode);
} catch (e) {
const snodeStr = snode ? `${snode.ip}:${snode.port}` : 'null';

@ -41,7 +41,7 @@ async function handlePublicMessageSentSuccess(
}
}
// tslint:disable-next-line: cyclomatic-complexity
// tslint:disable-next-line:// tslint:disable-next-line: cyclomatic-complexity
async function handleMessageSentSuccess(
sentMessage: RawMessage,
effectiveTimestamp: number,
@ -100,14 +100,13 @@ async function handleMessageSentSuccess(
void PnServer.notifyPnServer(wrappedEnvelope, sentMessage.device);
}
}
if (!shouldMarkMessageAsSynced && fetchedMessage.get('expirationType')) {
if (!shouldMarkMessageAsSynced) {
const expirationType = fetchedMessage.get('expirationType');
if (expirationType) {
fetchedMessage =
setExpirationStartTimestamp(
fetchedMessage,
fetchedMessage.get('expirationType')!,
effectiveTimestamp
) || fetchedMessage;
setExpirationStartTimestamp(fetchedMessage, expirationType, effectiveTimestamp) ||
fetchedMessage;
}
}
// Handle the sync logic here
@ -170,10 +169,9 @@ async function handleMessageSentFailure(
}
}
if (fetchedMessage.get('expirationType')) {
fetchedMessage =
setExpirationStartTimestamp(fetchedMessage, fetchedMessage.get('expirationType')!) ||
fetchedMessage;
const expirationType = fetchedMessage.get('expirationType');
if (expirationType) {
fetchedMessage = setExpirationStartTimestamp(fetchedMessage, expirationType) || fetchedMessage;
}
// always mark the message as sent.

@ -16,7 +16,6 @@ import { getIntl } from './user';
import { BlockedNumberController } from '../../util';
import { ConversationModel } from '../../models/conversation';
import { LocalizerType } from '../../types/Util';
import { ConversationHeaderTitleProps } from '../../components/conversation/ConversationHeader';
import { ReplyingToMessageProps } from '../../components/conversation/composition/CompositionBox';
import { MessageAttachmentSelectorProps } from '../../components/conversation/message/message-content/MessageAttachment';
import { MessageAuthorSelectorProps } from '../../components/conversation/message/message-content/MessageAuthorText';
@ -38,6 +37,7 @@ import { ConversationTypeEnum } from '../../models/conversationAttributes';
import { MessageReactsSelectorProps } from '../../components/conversation/message/message-content/MessageReactions';
import { filter, isEmpty, pick, sortBy } from 'lodash';
import { DisappearingMessageConversationSetting } from '../../util/expiringMessages';
import { ConversationHeaderTitleProps } from '../../components/conversation/ConversationHeaderTitle';
export const getConversations = (state: StateType): ConversationsStateType => state.conversations;

@ -45,7 +45,9 @@ async function onReadReceipt(receipt: { source: string; timestamp: number; readA
// readBy is only used for private conversations
// we do not care of who read it. If the length is > 0 , it is read and false otherwise
let readBy = message.get('read_by') || [];
let expirationStartTimestamp = undefined;
// TODO Fix this with read receipts
// tslint:disable-next-line: no-unnecessary-initializer
const expirationStartTimestamp = undefined;
if (!readBy.length) {
readBy.push(receipt.source);

Loading…
Cancel
Save