From 5c7c56ac9932c43322f6ebbbd194f06e45cf2773 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Fri, 14 Jul 2017 12:16:18 +0200 Subject: [PATCH] android-notify stop login attempter if coreReady In case the login was made manually by the user via the grafical interface when the autologin managaer has already started but not logged in yet, the password attempt timer was looping to infinite causing unnecessary load and log spamming, this commit attempt to prevent that from happening --- .../src/AutologinManager.qml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/retroshare-android-notify-service/src/AutologinManager.qml b/retroshare-android-notify-service/src/AutologinManager.qml index f7171ed99..af299a505 100644 --- a/retroshare-android-notify-service/src/AutologinManager.qml +++ b/retroshare-android-notify-service/src/AutologinManager.qml @@ -58,7 +58,11 @@ QtObject var runState = jsonReponse.data.runstate if(typeof(runState) !== 'string') { - console.log("runStateCallback(par)", "Core hanged!", par.response) + coreReady = false + console.log("runStateCallback(par)", + "Core hanged!", + "typeof(runState):", typeof(runState), + "par.response:", par.response) return } @@ -70,7 +74,7 @@ QtObject break case "fatal_error": coreReady = false - console.log("Core hanged") + console.log("Core hanged! runState:", runState) break case "waiting_account_select": coreReady = false @@ -145,7 +149,11 @@ QtObject interval: 700 repeat: true triggeredOnStart: true - onTriggered: rsApi.request("/control/password/", "", attemptPasswordCB) + onTriggered: + { + if(am.coreReady) attemptPasswordCBCB() + else rsApi.request("/control/password/", "", attemptPasswordCB) + } function attemptPasswordCB(par) {