8000 new lead push notification for admin · vishal-coder/CRM_frontend@cd19ade · GitHub
[go: up one dir, main page]

Skip to content

Commit cd19ade

Browse files
committed
new lead push notification for admin
1 parent 94957f6 commit cd19ade

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/components/Sidebar.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,19 @@ function Sidebar() {
1616
// dispatch(addNewpost(data.fullDocument));
1717
// toast.success("New user added to list");
1818
});
19-
socket.on("lead added", (data) => {
19+
socket.on("new lead", (data) => {
2020
console.log("lead added", data);
21-
// dispatch(addNewpost(data.fullDocument));
22-
// toast.success("New lead added to list");
21+
toast.success("New Lead added by user ");
2322
});
2423
socket.on("new contact", (data) => {
2524
console.log("contact added--", data);
26-
// dispatch(addNewpost(data.fullDocument));
27-
// toast.success("New lead added to list");
28-
});
29-
socket.on("contact added", (data) => {
30-
console.log("contact added", data);
31-
// dispatch(addNewpost(data.fullDocument));
3225
toast.success("New Contact added by user ");
3326
});
27+
28+
return () => {
29+
socket.off("new lead");
30+
socket.off("new contact");
31+
};
3432
}, []);
3533
return (
3634
<nav className="flex-column sidebar">

0 commit comments

Comments
 (0)
0