Skip to content

Commit

Permalink
Merge pull request #622 from juanky201271/stable_bugfix_620
Browse files Browse the repository at this point in the history
Bugfix 620
  • Loading branch information
juanky201271 authored Mar 19, 2024
2 parents 3f6c78a + 5e7963c commit 0029388
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 14 deletions.
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
32 changes: 24 additions & 8 deletions app/rpc/RPC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1552,22 +1552,28 @@ 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))
.then(r => {
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);
})
Expand Down Expand Up @@ -1614,7 +1620,7 @@ export default class RPC {
return;
}

//console.log('progress', progress);
console.log('progress', progress);

// Calculate ETA.
let secondsPerComputation = 3; // default
Expand Down Expand Up @@ -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;
Expand All @@ -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
});
Expand Down
2 changes: 1 addition & 1 deletion app/translations/en.json
Original file line number Diff line number Diff line change
@@ -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...",
Expand Down
2 changes: 1 addition & 1 deletion app/translations/es.json
Original file line number Diff line number Diff line change
@@ -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...",
Expand Down
2 changes: 1 addition & 1 deletion app/translations/pt.json
Original file line number Diff line number Diff line change
@@ -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...",
Expand Down
4 changes: 2 additions & 2 deletions ios/ZingoMobile.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "";
Expand Down Expand Up @@ -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 = "";
Expand Down

0 comments on commit 0029388

Please sign in to comment.