Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
adityapk00 committed May 6, 2021
1 parent 08305ba commit bd68c7b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/components/Send.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ const ConfirmModalInternal = ({
if (progress && progress.sendInProgress) {
openErrorModal(
`Computing Transaction`,
`Building...\n${progress.progress} of ${progress.total}\nETA ${progress.etaSeconds}s`
`Step ${progress.progress} of ${progress.total}. ETA ${progress.etaSeconds}s`
);
}
};
Expand Down
8 changes: 7 additions & 1 deletion app/rpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,13 @@ export default class RPC {
const progress = JSON.parse(native.litelib_execute('sendprogress', ''));
console.log(progress);

const updatedProgress = new SendProgress();
if (progress.id === prevSendId) {
// Still not started, so wait for more time
setSendProgress(updatedProgress);
return;
}

// Calculate ETA.
let secondsPerComputation = 3; // defalt
if (progress.progress > 0) {
Expand All @@ -453,7 +460,6 @@ export default class RPC {
eta = 1;
}

const updatedProgress = new SendProgress();
updatedProgress.progress = progress.progress;
updatedProgress.total = Math.max(progress.total, progress.progress); // sometimes, due to change, the total can be off by 1
updatedProgress.sendInProgress = true;
Expand Down

0 comments on commit bd68c7b

Please sign in to comment.