fix: resolve cyclic imports with LokiProfile and MessageResultProps

pull/3083/head
William Grant 11 months ago
parent 51a36e6cb0
commit 6db6a1f65d

@ -1,17 +1,15 @@
import styled, { CSSProperties } from 'styled-components';
import { useConversationUsername, useIsPrivate } from '../../hooks/useParamSelector';
import { MessageAttributes } from '../../models/messageType';
import { UserUtils } from '../../session/utils';
import { getOurPubKeyStrFromCache } from '../../session/utils/User';
import { openConversationToSpecificMessage } from '../../state/ducks/conversations';
import { MessageResultProps } from '../../types/message';
import { Avatar, AvatarSize } from '../avatar/Avatar';
import { MessageBodyHighlight } from '../basic/MessageBodyHighlight';
import { ContactName } from '../conversation/ContactName';
import { Timestamp } from '../conversation/Timestamp';
export type MessageResultProps = MessageAttributes & { snippet: string };
const StyledConversationTitleResults = styled.div`
flex-grow: 1;
flex-shrink: 1;

@ -1,7 +1,6 @@
// eslint:disable: no-require-imports no-var-requires one-variable-per-declaration no-void-expression function-name
import _, { isEmpty } from 'lodash';
import { MessageResultProps } from '../components/search/MessageSearchResults';
import { ConversationModel } from '../models/conversation';
import { ConversationAttributes } from '../models/conversationAttributes';
import { MessageCollection, MessageModel } from '../models/message';
@ -13,6 +12,7 @@ import { getSodiumRenderer } from '../session/crypto';
import { DisappearingMessages } from '../session/disappearing_messages';
import { PubKey } from '../session/types';
import { fromArrayBufferToBase64, fromBase64ToArrayBuffer } from '../session/utils/String';
import { MessageResultProps } from '../types/message';
import {
AsyncWrapper,
MsgDuplicateSearchOpenGroup,

@ -1,5 +1,5 @@
import { SignalService } from '../../../../protobuf';
import { LokiProfile } from '../../../../types/Message';
import { LokiProfile } from '../../../../types/message';
import { ContentMessage } from '../ContentMessage';
import { MessageParams } from '../Message';
import { buildProfileForOutgoingMessage } from '../visibleMessage/VisibleMessage';

@ -1,8 +1,8 @@
import ByteBuffer from 'bytebuffer';
import { isEmpty } from 'lodash';
import { SignalService } from '../../../../protobuf';
import { LokiProfile } from '../../../../types/Message';
import { Reaction } from '../../../../types/Reaction';
import { LokiProfile } from '../../../../types/message';
import { ExpirableMessage, ExpirableMessageParams } from '../ExpirableMessage';
interface AttachmentPointerCommon {

@ -1,12 +1,12 @@
import _ from 'lodash';
import { UserUtils } from '.';
import { Data } from '../../data/data';
import { SessionKeyPair } from '../../receiver/keypairs';
import { LokiProfile } from '../../types/message';
import { Storage, getOurPubKeyStrFromStorage } from '../../util/storage';
import { getConversationController } from '../conversations';
import { PubKey } from '../types';
import { fromHexToArray, toHex } from './String';
import { getConversationController } from '../conversations';
import { LokiProfile } from '../../types/Message';
import { getOurPubKeyStrFromStorage, Storage } from '../../util/storage';
import { SessionKeyPair } from '../../receiver/keypairs';
export type HexKeyPair = {
pubKey: string;

@ -4,10 +4,10 @@ import { Data } from '../../data/data';
import { AdvancedSearchOptions, SearchOptions } from '../../types/Search';
import { cleanSearchTerm } from '../../util/cleanSearchTerm';
import { MessageResultProps } from '../../components/search/MessageSearchResults';
import { ConversationTypeEnum } from '../../models/conversationAttributes';
import { PubKey } from '../../session/types';
import { UserUtils } from '../../session/utils';
import { MessageResultProps } from '../../types/message';
import { ReduxConversationType } from './conversations';
// State

@ -3,10 +3,10 @@ import { compact, isEmpty } from 'lodash';
import { StateType } from '../reducer';
import { MessageResultProps } from '../../types/message';
import { ConversationLookupType } from '../ducks/conversations';
import { SearchStateType } from '../ducks/search';
import { getConversationLookup } from './conversations';
import { MessageResultProps } from '../../components/search/MessageSearchResults';
export const getSearch = (state: StateType): SearchStateType => state.search;

@ -1,5 +0,0 @@
export type LokiProfile = {
displayName: string;
avatarPointer?: string;
profileKey: Uint8Array | null;
};

@ -0,0 +1,11 @@
import { MessageAttributes } from '../../models/messageType';
type LokiProfile = {
displayName: string;
avatarPointer?: string;
profileKey: Uint8Array | null;
};
type MessageResultProps = MessageAttributes & { snippet: string };
export { LokiProfile, MessageResultProps };
Loading…
Cancel
Save