From 3c516a2e33aab1e80ab5af38fc898ee2b8cbd6b7 Mon Sep 17 00:00:00 2001 From: Loh Boon Keat Date: Fri, 24 Jun 2022 01:38:23 +0800 Subject: [PATCH] fix minor bug --- addon/appModules/whatsapp.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) 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)