mirror of
				https://github.com/liberatedsystems/openCom-Companion.git
				synced 2025-07-08 05:07:21 +02:00 
			
		
		
		
	Fixed new conversation error dialog being wonky
This commit is contained in:
		
							parent
							
								
									0cbd4c71ab
								
							
						
					
					
						commit
						fe4c61880e
					
				@ -2627,11 +2627,15 @@ class SidebandApp(MDApp):
 | 
				
			|||||||
                    RNS.log("Error while creating conversation: "+str(e), RNS.LOG_ERROR)
 | 
					                    RNS.log("Error while creating conversation: "+str(e), RNS.LOG_ERROR)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if new_result:
 | 
					                if new_result:
 | 
				
			||||||
 | 
					                    dialog.d_content.ids["n_address_field"].helper_text = ""
 | 
				
			||||||
 | 
					                    dialog.d_content.ids["n_address_field"].helper_text_mode = "on_focus"
 | 
				
			||||||
                    dialog.d_content.ids["n_address_field"].error = False
 | 
					                    dialog.d_content.ids["n_address_field"].error = False
 | 
				
			||||||
                    dialog.dismiss()
 | 
					                    dialog.dismiss()
 | 
				
			||||||
                    if self.conversations_view != None:
 | 
					                    if self.conversations_view != None:
 | 
				
			||||||
                        self.conversations_view.update()
 | 
					                        self.conversations_view.update()
 | 
				
			||||||
                else:
 | 
					                else:
 | 
				
			||||||
 | 
					                    dialog.d_content.ids["n_address_field"].helper_text = "Invalid address, check your input"
 | 
				
			||||||
 | 
					                    dialog.d_content.ids["n_address_field"].helper_text_mode = "persistent"
 | 
				
			||||||
                    dialog.d_content.ids["n_address_field"].error = True
 | 
					                    dialog.d_content.ids["n_address_field"].error = True
 | 
				
			||||||
                    # dialog.d_content.ids["n_error_field"].text = "Could not create conversation. Check your input."
 | 
					                    # dialog.d_content.ids["n_error_field"].text = "Could not create conversation. Check your input."
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -4264,6 +4264,10 @@ class SidebandCore():
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        try:
 | 
					        try:
 | 
				
			||||||
            addr_b = bytes.fromhex(dest_str)
 | 
					            addr_b = bytes.fromhex(dest_str)
 | 
				
			||||||
 | 
					            if addr_b == self.lxmf_destination.hash:
 | 
				
			||||||
 | 
					                RNS.log("Cannot create conversation with own LXMF address", RNS.LOG_ERROR)
 | 
				
			||||||
 | 
					                return False
 | 
				
			||||||
 | 
					            else:
 | 
				
			||||||
                self._db_create_conversation(addr_b, name, trusted)
 | 
					                self._db_create_conversation(addr_b, name, trusted)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        except Exception as e:
 | 
					        except Exception as e:
 | 
				
			||||||
 | 
				
			|||||||
@ -524,8 +524,8 @@ Builder.load_string("""
 | 
				
			|||||||
        id: n_address_field
 | 
					        id: n_address_field
 | 
				
			||||||
        max_text_length: 32
 | 
					        max_text_length: 32
 | 
				
			||||||
        hint_text: "Address"
 | 
					        hint_text: "Address"
 | 
				
			||||||
        helper_text: "Error, check your input"
 | 
					        helper_text: ""
 | 
				
			||||||
        helper_text_mode: "on_error"
 | 
					        helper_text_mode: "on_focus"
 | 
				
			||||||
        text: ""
 | 
					        text: ""
 | 
				
			||||||
        font_size: dp(24)
 | 
					        font_size: dp(24)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user