Skip to content

Commit 5ac0e2f

Browse files
author
Lucas Araujo
committed
[DDW_812] Stop ipc sync messages after pushingLedger 100%
1 parent 87bfb71 commit 5ac0e2f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

source/main/utils/handleCheckBlockReplayProgress.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,19 @@ export const handleCheckBlockReplayProgress = (
8181
{ progress: finalProgressPercentage, type: progressType },
8282
mainWindow.webContents
8383
);
84+
85+
if (finalProgressPercentage === 100 && progressType === 'pushingLedger') {
86+
clearInterval(checkBlockReplayProgressInterval);
87+
}
8488
};
8589

8690
const setBlockReplayProgressCheckingInterval = () => {
87-
setInterval(async () => {
91+
return setInterval(async () => {
8892
checkBlockReplayProgress();
8993
}, BLOCK_REPLAY_PROGRESS_CHECK_INTERVAL);
9094
};
9195

9296
// Start default interval
93-
setBlockReplayProgressCheckingInterval();
97+
const checkBlockReplayProgressInterval = setBlockReplayProgressCheckingInterval();
9498
return checkBlockReplayProgress;
9599
};

0 commit comments

Comments
 (0)