From 3ceee1db4f982218e4b38fb3496aa7b3586d4c72 Mon Sep 17 00:00:00 2001 From: Zhongheng Liu Date: Mon, 1 Apr 2024 21:50:05 +0300 Subject: [PATCH] misc changes and added method stub for encryption support --- src/Chat/Chat.tsx | 6 +++++- src/Sidebar/Sidebar.tsx | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Chat/Chat.tsx b/src/Chat/Chat.tsx index 1aa884a..1d50239 100644 --- a/src/Chat/Chat.tsx +++ b/src/Chat/Chat.tsx @@ -13,6 +13,10 @@ import strings from "../Intl/strings.json"; import { LangContext } from "../context"; import { connectionAddress, endpoints } from "../consts"; const Chat = ({ user }: { user: string }): React.ReactElement => { + const encryptMessage = (plaintext: string) => { + const ciphertext = plaintext; + return ciphertext; + } const lang = useContext(LangContext); const chatPage = strings[lang].chat; const [messages, setMessages] = useState([]); @@ -78,7 +82,7 @@ const Chat = ({ user }: { user: string }): React.ReactElement => { type: MessageType.MESSAGE, fromUserId: user, toUserId: "everyone", - content: entryElement.value, + content: encryptMessage(entryElement.value), timeMillis: Date.now(), }; console.log( diff --git a/src/Sidebar/Sidebar.tsx b/src/Sidebar/Sidebar.tsx index ea5dfed..ef154c3 100644 --- a/src/Sidebar/Sidebar.tsx +++ b/src/Sidebar/Sidebar.tsx @@ -1,4 +1,3 @@ -import { useState } from "react"; import "./Sidebar.css"; import { SidebarMenu } from "./Components/SidebarMenu"; export const Sidebar = ({