Skip to content

Commit

Permalink
fix: txids fix when sending
Browse files Browse the repository at this point in the history
  • Loading branch information
juanky201271 committed Nov 22, 2024
1 parent 3b6747f commit cd19572
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions app/rpc/RPC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1450,7 +1450,7 @@ export default class RPC {
const rJson: RPCSendType = JSON.parse(r);
if (rJson.error) {
sendError = rJson.error;
} else if (rJson.txids) {
} else if (rJson.txids && rJson.txids.length > 0) {
sendTxids = rJson.txids.join(', ');
}
} catch (e) {
Expand Down Expand Up @@ -1546,7 +1546,7 @@ export default class RPC {
// 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.txids && !progress.error && !sendTxids && !sendError) {
if ((!progress.txids || progress.txids.length === 0) && !progress.error && !sendTxids && !sendError) {
// Still processing
setSendProgress(updatedProgress);
return;
Expand All @@ -1556,7 +1556,7 @@ export default class RPC {
clearInterval(intervalID);
setSendProgress({} as SendProgressClass);

if (progress.txids) {
if (progress.txids && progress.txids.length > 0) {
// And refresh data (full refresh)
this.refresh(true);
// send process is about to finish - reactivate the syncing flag
Expand Down
2 changes: 1 addition & 1 deletion app/rpc/types/RPCSendProgressType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export type RPCSendProgressType = {
sending: boolean;
progress: number;
total: number;
txids: string[] | null;
txids: string[];
error: string | null;
sync_interrupt: boolean;
};

0 comments on commit cd19572

Please sign in to comment.