Clear turnstile if migration is done while progress box is opened
This commit is contained in:
@@ -96,7 +96,8 @@ void MainWindow::turnstileProgress() {
|
|||||||
QIcon icon = QApplication::style()->standardIcon(QStyle::SP_MessageBoxWarning);
|
QIcon icon = QApplication::style()->standardIcon(QStyle::SP_MessageBoxWarning);
|
||||||
progress.msgIcon->setPixmap(icon.pixmap(64, 64));
|
progress.msgIcon->setPixmap(icon.pixmap(64, 64));
|
||||||
|
|
||||||
auto fnUpdateProgressUI = [=] () {
|
bool migrationFinished = false;
|
||||||
|
auto fnUpdateProgressUI = [=, &migrationFinished] () mutable {
|
||||||
// Get the plan progress
|
// Get the plan progress
|
||||||
if (rpc->getTurnstile()->isMigrationPresent()) {
|
if (rpc->getTurnstile()->isMigrationPresent()) {
|
||||||
auto curProgress = rpc->getTurnstile()->getPlanProgress();
|
auto curProgress = rpc->getTurnstile()->getPlanProgress();
|
||||||
@@ -110,6 +111,7 @@ void MainWindow::turnstileProgress() {
|
|||||||
progress.toAddr->setText(curProgress.to);
|
progress.toAddr->setText(curProgress.to);
|
||||||
|
|
||||||
if (curProgress.step == curProgress.totalSteps) {
|
if (curProgress.step == curProgress.totalSteps) {
|
||||||
|
migrationFinished = true;
|
||||||
auto txt = QString("Turnstile migration finished");
|
auto txt = QString("Turnstile migration finished");
|
||||||
if (curProgress.hasErrors) {
|
if (curProgress.hasErrors) {
|
||||||
txt = txt + ". There were some errors.\n\nYour funds are all in your wallet, so you should be able to finish moving them manually.";
|
txt = txt + ". There were some errors.\n\nYour funds are all in your wallet, so you should be able to finish moving them manually.";
|
||||||
@@ -156,7 +158,7 @@ void MainWindow::turnstileProgress() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
d.exec();
|
d.exec();
|
||||||
if (curProgress.step == curProgress.totalSteps) {
|
if (migrationFinished || curProgress.step == curProgress.totalSteps) {
|
||||||
// Finished, so delete the file
|
// Finished, so delete the file
|
||||||
rpc->getTurnstile()->removeFile();
|
rpc->getTurnstile()->removeFile();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user