mirror of
				https://github.com/nerzhul/ocsms.git
				synced 2025-10-31 02:17:38 +00:00 
			
		
		
		
	Remove duplicate phonenumbers in conversation list
This commit is contained in:
		
							parent
							
								
									c4a78bf584
								
							
						
					
					
						commit
						a620277d86
					
				| @ -200,14 +200,21 @@ function fetchConversation(phoneNumber) { | ||||
| 				var len = jsondata["phoneNumbers"].length; | ||||
| 				var ctLen = 0; | ||||
| 				phoneNumberLabel = ''; | ||||
| 				// This array permit to remove double entries
 | ||||
| 				phoneNumberShown = []; | ||||
| 
 | ||||
| 				$.each(jsondata["phoneNumbers"], function(id, val) { | ||||
| 					// Don't add phone numbers is they are already shown
 | ||||
| 					if ($.inArray(val, phoneNumberShown)) { | ||||
| 						continue; | ||||
| 					} | ||||
| 					phoneNumberLabel += val; | ||||
| 					ctLen++; | ||||
| 					if (ctLen != len) { | ||||
| 						phoneNumberLabel += ","; | ||||
| 					} | ||||
| 					phoneNumberLabel += " "; | ||||
| 					phoneNumberShown.push(val); | ||||
| 				}); | ||||
| 			} | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user