Skip to content

Commit

Permalink
Merge branch 'master' of github.com:followmedoug/totvs-chat-teste
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcus Mesquita committed Oct 28, 2022
2 parents 6e03f63 + 21f41d4 commit 6557109
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
7 changes: 0 additions & 7 deletions src/components/Organisms/ActiveChat/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,6 @@ const ActiveChat = ({ user, contact }) => {
};
}, [message]);

const filter1 = data
.filter(({ origin }) => origin.id === id || origin.id === contact.id)
.filter(
({ destination }) =>
destination.id === id || destination.id === contact.id
);

return (
<Container>
<Header
Expand Down
2 changes: 1 addition & 1 deletion src/components/Organisms/ContactList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Contact from "../../Molecules/Contact";
const ContactList = ({ contacts = [], onClick, active, id }) => {
return (
<Container>
{contacts.length &&
{contacts.length > 0 &&
contacts
.filter((item) => item?.id !== id)
.map((contact, key) => (
Expand Down
5 changes: 5 additions & 0 deletions src/components/Templates/Contacts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import NewChat from "../../Organisms/NewChat";
import AddContact from "../../Organisms/AddContact";
import { getContactsRequest } from "../../../store/reducers/contactSlice";
import Container from "./style";
import { getActiveChatsRequest } from "../../../store/reducers/userSlice";

const Contacts = ({ onClick, active }) => {
const dispatch = useDispatch();
Expand All @@ -24,6 +25,10 @@ const Contacts = ({ onClick, active }) => {
dispatch(getContactsRequest());
}, []);

useEffect(() => {
dispatch(getActiveChatsRequest({ id }));
}, [id]);

return (
<Container>
{showNewChat ? (
Expand Down

0 comments on commit 6557109

Please sign in to comment.