| 
									
										
										
										
											2024-01-29 11:48:20 +00:00
										 |  |  | const usersSocket = require("../libs/socket"); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export const removeUserFromOlineList = (userId: any) => { | 
					
						
							| 
									
										
										
										
											2024-01-30 12:50:37 +00:00
										 |  |  |   let index = usersSocket?.ob?.listOnline?.findIndex((o: any) => o?.id == userId); | 
					
						
							| 
									
										
										
										
											2024-01-29 11:48:20 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |   if (index != -1) { | 
					
						
							| 
									
										
										
										
											2024-01-30 12:50:37 +00:00
										 |  |  |     usersSocket?.ob?.listOnline?.splice(index, 1); | 
					
						
							| 
									
										
										
										
											2024-01-29 11:48:20 +00:00
										 |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   index = -1; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-30 12:50:37 +00:00
										 |  |  |   index = usersSocket?.ob?.listOnlineAux?.findIndex((o: any) => o?.id == userId); | 
					
						
							| 
									
										
										
										
											2024-01-29 11:48:20 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |   if (index != -1) { | 
					
						
							| 
									
										
										
										
											2024-01-30 12:50:37 +00:00
										 |  |  |     usersSocket?.ob?.listOnlineAux?.splice(index, 1); | 
					
						
							| 
									
										
										
										
											2024-01-29 11:48:20 +00:00
										 |  |  |   } | 
					
						
							|  |  |  | }; |