diff --git a/client/app/screens/chat/ChatScreen.tsx b/client/app/screens/chat/ChatScreen.tsx index 8df8f91fd..6885a5c61 100644 --- a/client/app/screens/chat/ChatScreen.tsx +++ b/client/app/screens/chat/ChatScreen.tsx @@ -1,5 +1,4 @@ import * as Crypto from "expo-crypto"; -import React, { useEffect } from "react"; import { KeyboardAvoidingView, Platform, @@ -17,6 +16,7 @@ import { useSettings } from "../../contexts/SettingsContext"; import { useSocket } from "../../contexts/SocketContext"; import { AuthStore } from "../../services/AuthStore"; import { Message } from "../../types/Message"; +import { useState, useEffect } from "react"; const ChatScreen = () => { const settings = useSettings(); @@ -28,8 +28,9 @@ const ChatScreen = () => { // Note: To prevent complexity, all user information is grabbed from different contexts and services. If we wanted most information inside of UserContext, we would have to import contexts within contexts and have state change as certain things mount, which could cause errors that are difficult to pinpoint. // Message loading and sending logic - const [messages, setMessages] = React.useState([]); - const [messageContent, setMessageContent] = React.useState(""); + const [messages, setMessages] = useState([]); + const [messageContent, setMessageContent] = useState(""); + useEffect(() => { if (socket === null) return; // This line might need to be changed diff --git a/client/app/screens/settings/SettingsScreen.tsx b/client/app/screens/settings/SettingsScreen.tsx index b30058790..5fd8664af 100644 --- a/client/app/screens/settings/SettingsScreen.tsx +++ b/client/app/screens/settings/SettingsScreen.tsx @@ -8,7 +8,7 @@ import { SettingsItem } from "../../components/settings/SettingsItem"; // select type: arrow to the right to switch pages const Sections = [ { - header: "Notications", + header: "Notifications", items: [ { id: "notifiyNewMessage", @@ -46,13 +46,14 @@ const SettingsScreen: React.FC = () => { Settings {Sections.map(({ header, items }) => ( - + {header} {items.map(({ id, title, type }) => (