diff --git a/components/sections/friends/add/index.tsx b/components/sections/friends/add/index.tsx index 238da90..440d36b 100644 --- a/components/sections/friends/add/index.tsx +++ b/components/sections/friends/add/index.tsx @@ -32,17 +32,12 @@ const AddFriend = (props: IAddFriendProps) => { } if (props) { - const { onAddFriendHandler, onSelectGroupHandler, groups, - // setGroup, setMessages, setSection - } = props; + const { onAddFriendHandler, onSelectGroupHandler, groups } = props; const handleInvitation = async () => { const tempGroup = groups?.find(g => g.targetId === user?.id); if (tempGroup) { onSelectGroupHandler(tempGroup.id); - // setGroup(tempGroup); - // setMessages(tempGroup?.messages); - // setSection(sections.group); return; } setLoading(true); @@ -56,8 +51,7 @@ const AddFriend = (props: IAddFriendProps) => { const handleSearch = (event: { preventDefault: () => void }) => { event.preventDefault(); - const value = searchRef?.current?.value ?? ""; - const length = value.length; + const value = searchRef?.current?.value ?? "", length = value.length; setUserFound(userSearchMessageTypes.notFound); if (users && value) { const user = users.find( diff --git a/components/sections/index.tsx b/components/sections/index.tsx index f29fa06..96c39dc 100644 --- a/components/sections/index.tsx +++ b/components/sections/index.tsx @@ -21,7 +21,6 @@ const SectionSwitch = (props: ISecitonSwitchProps) => { messages, group, setGroup, - setMessages, active, notifs, lastMessageRef, @@ -61,9 +60,7 @@ const SectionSwitch = (props: ISecitonSwitchProps) => { } else if (section === sections.addFriend) { return (
- +
); } else if (section === sections.feeds) { diff --git a/pages/index.tsx b/pages/index.tsx index c078b2a..5f1fdff 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -609,7 +609,6 @@ const Messages = () => { user={user} group={group} setGroup={setGroup} - setMessages={setMessages} messages={messages} textInputRef={textInputRef} input={input} diff --git a/types/index.tsx b/types/index.tsx index 736d397..64ba5b0 100644 --- a/types/index.tsx +++ b/types/index.tsx @@ -270,7 +270,6 @@ export interface ISecitonSwitchProps { onAddFriendHandler: Function; onSelectGroupHandler: Function; setGroup: Function; - setMessages: Function; lastMessageRef: null | LegacyRef; textInputRef: LegacyRef | null; navbar: boolean; @@ -311,7 +310,4 @@ export interface IAddFriendProps { onAddFriendHandler: Function; onSelectGroupHandler: Function; groups: IGroupProps[] | null | undefined; - // setGroup: Function; - // setMessages: Function; - // setSection: Function; }