Skip to content

Commit

Permalink
Update ApiProvider.js
Browse files Browse the repository at this point in the history
  • Loading branch information
AxeRicin committed Dec 29, 2023
1 parent ecdd975 commit e477316
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions frontend/src/hoc/ApiProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const ApiProvider = ({ children }) => {
const connectSocket = () => {
socket.connect();

socket.on('newMessage', (newMessage) => console.log(newMessage) || dispatch(addMessage(newMessage)));
socket.on('newMessage', (newMessage) => dispatch(addMessage(newMessage)));

socket.on('removeChannel', ({ id }) => {
dispatch(removeChannel(id));
Expand All @@ -46,7 +46,6 @@ const ApiProvider = ({ children }) => {

const sendNewMessage = (message) => new Promise((resolve, rejected) => {
socket.timeout(msTimeout).emit('newMessage', message, (err, response) => {
console.log(response);
if (err) rejected(err);
else {
resolve(response);
Expand Down

0 comments on commit e477316

Please sign in to comment.