diff --git a/addon/appModules/whatsapp.py b/addon/appModules/whatsapp.py index 7601af2..a238c4d 100644 --- a/addon/appModules/whatsapp.py +++ b/addon/appModules/whatsapp.py @@ -53,13 +53,9 @@ def configFile(self): # Function that receives the UIAAutomationId by parameter, and returns the match object def get(self, id, errorMessage, gesture): -# for obj in api.getForegroundObject().children[1].children: -# if obj.UIAAutomationId == id: -# return obj# - fg = api.getForegroundObject().children[1] - for obj in fg.children: + for obj in api.getForegroundObject().children[1].children: if obj.UIAAutomationId == id: - return obj + return obj# if errorMessage: message(self.notFound) if gesture: @@ -176,7 +172,7 @@ def script_backAndCloseButton(self, gesture): ) def script_chatsList(self, gesture): chatList = self.get('ChatList', False, None) - if ChatList: + if chatList: chatList.firstChild.children[0].setFocus() else: message(self.notFound)