Skip to content

Commit

Permalink
fix: fixed verification on send
Browse files Browse the repository at this point in the history
  • Loading branch information
mishramonalisha76 committed Aug 24, 2023
1 parent 064f01d commit e63777f
Show file tree
Hide file tree
Showing 6 changed files with 527 additions and 544 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { ThemeContext } from '../theme/ThemeProvider';
import { IChatTheme } from '../theme';
import useFetchConversationHash from '../../../hooks/chat/useFetchConversationHash';

import { EncryptionMessage } from './MessageEncryption';
import { ENCRYPTION_KEYS, EncryptionMessage } from './MessageEncryption';
import useGetGroup from '../../../hooks/chat/useGetGroup';
import useGetChatProfile from '../../../hooks/useGetChatProfile';
import useFetchChat from '../../../hooks/chat/useFetchChat';
Expand Down Expand Up @@ -308,9 +308,9 @@ export const ChatViewList: React.FC<IChatViewListProps> = (
(chatFeed.publicKey ||
(chatFeed?.groupInformation &&
!chatFeed?.groupInformation?.isPublic)) ? (
<EncryptionMessage id={'ENCRYPTED'} />
<EncryptionMessage id={ENCRYPTION_KEYS.ENCRYPTED} />
) : (
<EncryptionMessage id={'NO_ENCRYPTED'} />
<EncryptionMessage id={chatFeed?.groupInformation?ENCRYPTION_KEYS.NO_ENCRYPTED_GROUP:ENCRYPTION_KEYS.NO_ENCRYPTED} />
)}

{chatStatusText && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ import { ThemeContext } from "../theme/ThemeProvider";
import { NoEncryptionIcon } from "../../../icons/NoEncryption";
import { EncryptionIcon } from "../../../icons/Encryption";

export const ENCRYPTION_KEYS = {
ENCRYPTED: 'ENCRYPTED',
NO_ENCRYPTED: 'NO_ENCRYPTED',
NO_ENCRYPTED_GROUP: 'NO_ENCRYPTED_GROUP'
} as const;

export type EncryptionKeys = (typeof ENCRYPTION_KEYS)[keyof typeof ENCRYPTION_KEYS];

const EncryptionMessageContent = {
ENCRYPTED: {
IconComponent: <EncryptionIcon size="15" />,
Expand All @@ -15,8 +23,14 @@ const EncryptionMessageContent = {
IconComponent: <NoEncryptionIcon size="15" />,
text: `Messages are not encrypted`,
},
NO_ENCRYPTED_GROUP: {
IconComponent: <NoEncryptionIcon size="15" />,
text: `Messages in this group are not encrypted`,
},
};
export const EncryptionMessage = ({ id }: { id: 'ENCRYPTED' | 'NO_ENCRYPTED' }) => {


export const EncryptionMessage = ({ id }: { id: EncryptionKeys}) => {
console.log(id)
const theme = useContext(ThemeContext);
const isMobile = useDeviceWidthCheck(771);
Expand Down
Loading

0 comments on commit e63777f

Please sign in to comment.