File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -16,21 +16,19 @@ function Sidebar() {
16
16
// dispatch(addNewpost(data.fullDocument));
17
17
// toast.success("New user added to list");
18
18
} ) ;
19
- socket . on ( "lead added " , ( data ) => {
19
+ socket . on ( "new lead " , ( data ) => {
20
20
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 " ) ;
23
22
} ) ;
24
23
socket . on ( "new contact" , ( data ) => {
25
24
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));
32
25
toast . success ( "New Contact added by user " ) ;
33
26
} ) ;
27
+
28
+ return ( ) => {
29
+ socket . off ( "new lead" ) ;
30
+ socket . off ( "new contact" ) ;
31
+ } ;
34
32
} , [ ] ) ;
35
33
return (
36
34
< nav className = "flex-column sidebar" >
You can’t perform that action at this time.
0 commit comments