diff --git a/android/app/build.gradle b/android/app/build.gradle index 488bf3880..98c61b7db 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -143,7 +143,7 @@ android { applicationId 'org.ZingoLabs.Zingo' // Real minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 157 // Real + versionCode 158 // Real //versionCode 117 // @Test versionName "zingo-1.3.6" // Real missingDimensionStrategy 'react-native-camera', 'general' diff --git a/app/rpc/RPC.ts b/app/rpc/RPC.ts index fec4199be..40188c64e 100644 --- a/app/rpc/RPC.ts +++ b/app/rpc/RPC.ts @@ -1552,7 +1552,9 @@ export default class RPC { //console.log('prev progress id', prevSendId); - let sendFastError: string = ''; + // sometimes we need the result of send as well + let sendError: string = ''; + let sendTxid: string = ''; // This is async, so fire and forget this.doSend(JSON.stringify(sendJson)) @@ -1560,14 +1562,18 @@ export default class RPC { try { const rJson = JSON.parse(r); if (rJson.error) { - sendFastError = rJson.error; + sendError = rJson.error; + } else if (rJson.txid) { + sendTxid = rJson.txid; } - } catch (e) {} + } catch (e) { + sendError = r; + } console.log('End Send OK: ' + r); }) .catch(e => { if (e && e.message) { - sendFastError = e.message; + sendError = e.message; } console.log('End Send ERROR: ' + e); }) @@ -1614,7 +1620,7 @@ export default class RPC { return; } - //console.log('progress', progress); + console.log('progress', progress); // Calculate ETA. let secondsPerComputation = 3; // default @@ -1646,7 +1652,10 @@ export default class RPC { // if the send process is really fast (likely an error) and sendprogress is over // in this moment. - if (!progress.txid && !progress.error && progress.sending) { + // sometimes the progress.sending is false and txid and error are null + // in this moment I can use the values from the command send + + if (!progress.txid && !progress.error && !sendTxid && !sendError) { // Still processing setSendProgress(updatedProgress); return; @@ -1667,8 +1676,15 @@ export default class RPC { reject(progress.error); } - if (!progress.sending) { - reject(sendFastError); + if (sendTxid) { + // And refresh data (full refresh) + this.refresh(true); + + resolve(sendTxid); + } + + if (sendError) { + reject(sendError); } }, 2000); // Every 2 seconds }); diff --git a/app/translations/en.json b/app/translations/en.json index 5d282f9d0..d4488a550 100644 --- a/app/translations/en.json +++ b/app/translations/en.json @@ -1,6 +1,6 @@ { "zingo": "Zingo!", - "version": "zingo-1.3.6 (157)", + "version": "zingo-1.3.6 (158)", "loading": "loading...", "connectingserver": "Connecting to the server...", "wait": "Please wait...", diff --git a/app/translations/es.json b/app/translations/es.json index d4b80acc9..dbaa0f945 100644 --- a/app/translations/es.json +++ b/app/translations/es.json @@ -1,6 +1,6 @@ { "zingo": "Zingo!", - "version": "zingo-1.3.6 (157)", + "version": "zingo-1.3.6 (158)", "loading": "cargando...", "connectingserver": "Conectando con el servidor...", "wait": "Por favor espere...", diff --git a/app/translations/pt.json b/app/translations/pt.json index edabfce97..f5366039b 100644 --- a/app/translations/pt.json +++ b/app/translations/pt.json @@ -1,6 +1,6 @@ { "zingo": "Zingo!", - "version": "zingo-1.3.6 (157)", + "version": "zingo-1.3.6 (158)", "loading": "carregando...", "connectingserver": "Conectando-se ao servidor...", "wait": "Aguarde um momento...", diff --git a/ios/ZingoMobile.xcodeproj/project.pbxproj b/ios/ZingoMobile.xcodeproj/project.pbxproj index e27ed797f..b5e129b92 100644 --- a/ios/ZingoMobile.xcodeproj/project.pbxproj +++ b/ios/ZingoMobile.xcodeproj/project.pbxproj @@ -533,7 +533,7 @@ ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = ZingoMobile/ZingoMobile.entitlements; - CURRENT_PROJECT_VERSION = 157; + CURRENT_PROJECT_VERSION = 158; DEVELOPMENT_TEAM = 788KRST4S8; ENABLE_BITCODE = NO; EXCLUDED_ARCHS = ""; @@ -573,7 +573,7 @@ ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = ZingoMobile/ZingoMobile.entitlements; - CURRENT_PROJECT_VERSION = 157; + CURRENT_PROJECT_VERSION = 158; DEVELOPMENT_TEAM = 788KRST4S8; ENABLE_BITCODE = NO; EXCLUDED_ARCHS = "";