mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-25 05:06:45 +00:00
improve close timing of wallet loading dialog
This commit is contained in:
parent
81cde4756a
commit
6768ad2028
1 changed files with 6 additions and 9 deletions
|
@ -52,10 +52,7 @@ public class LoadWallet implements Runnable {
|
||||||
loadWalletService.setExecutor(Storage.LoadWalletService.getSingleThreadedExecutor());
|
loadWalletService.setExecutor(Storage.LoadWalletService.getSingleThreadedExecutor());
|
||||||
loadWalletService.setOnSucceeded(workerStateEvent -> {
|
loadWalletService.setOnSucceeded(workerStateEvent -> {
|
||||||
WalletAndKey walletAndKey = loadWalletService.getValue();
|
WalletAndKey walletAndKey = loadWalletService.getValue();
|
||||||
SparrowTerminal.get().getGuiThread().invokeLater(() -> {
|
openWallet(storage, walletAndKey);
|
||||||
SparrowTerminal.get().getGui().removeWindow(loadingDialog);
|
|
||||||
Platform.runLater(() -> openWallet(storage, walletAndKey));
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
loadWalletService.setOnFailed(workerStateEvent -> {
|
loadWalletService.setOnFailed(workerStateEvent -> {
|
||||||
Throwable exception = workerStateEvent.getSource().getException();
|
Throwable exception = workerStateEvent.getSource().getException();
|
||||||
|
@ -80,10 +77,7 @@ public class LoadWallet implements Runnable {
|
||||||
loadWalletService.setOnSucceeded(workerStateEvent -> {
|
loadWalletService.setOnSucceeded(workerStateEvent -> {
|
||||||
EventManager.get().post(new StorageEvent(storage.getWalletId(null), TimedEvent.Action.END, "Done"));
|
EventManager.get().post(new StorageEvent(storage.getWalletId(null), TimedEvent.Action.END, "Done"));
|
||||||
WalletAndKey walletAndKey = loadWalletService.getValue();
|
WalletAndKey walletAndKey = loadWalletService.getValue();
|
||||||
SparrowTerminal.get().getGuiThread().invokeLater(() -> {
|
openWallet(storage, walletAndKey);
|
||||||
SparrowTerminal.get().getGui().removeWindow(loadingDialog);
|
|
||||||
Platform.runLater(() -> openWallet(storage, walletAndKey));
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
loadWalletService.setOnFailed(workerStateEvent -> {
|
loadWalletService.setOnFailed(workerStateEvent -> {
|
||||||
EventManager.get().post(new StorageEvent(storage.getWalletId(null), TimedEvent.Action.END, "Failed"));
|
EventManager.get().post(new StorageEvent(storage.getWalletId(null), TimedEvent.Action.END, "Failed"));
|
||||||
|
@ -124,7 +118,10 @@ public class LoadWallet implements Runnable {
|
||||||
openWallet(entry.getValue(), entry.getKey());
|
openWallet(entry.getValue(), entry.getKey());
|
||||||
}
|
}
|
||||||
if(walletAndKey.getWallet().isMasterWallet()) {
|
if(walletAndKey.getWallet().isMasterWallet()) {
|
||||||
SparrowTerminal.get().getGuiThread().invokeLater(() -> getOpeningDialog(walletAndKey.getWallet()).showDialog(SparrowTerminal.get().getGui()));
|
SparrowTerminal.get().getGuiThread().invokeLater(() -> {
|
||||||
|
SparrowTerminal.get().getGui().removeWindow(loadingDialog);
|
||||||
|
getOpeningDialog(walletAndKey.getWallet()).showDialog(SparrowTerminal.get().getGui());
|
||||||
|
});
|
||||||
}
|
}
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
log.error("Wallet Error", e);
|
log.error("Wallet Error", e);
|
||||||
|
|
Loading…
Reference in a new issue