From 83c5d505c34e1ea5d32f0c655b2dd17bece34586 Mon Sep 17 00:00:00 2001 From: woodser Date: Thu, 14 Jul 2022 10:54:07 -0400 Subject: [PATCH] fix blank page when redirected to national currencies tab --- .../main/java/bisq/desktop/main/MainView.java | 32 +++++++++---------- .../java/bisq/desktop/main/MainViewModel.java | 2 +- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/desktop/src/main/java/bisq/desktop/main/MainView.java b/desktop/src/main/java/bisq/desktop/main/MainView.java index b3866a392d..fe8ddbc159 100644 --- a/desktop/src/main/java/bisq/desktop/main/MainView.java +++ b/desktop/src/main/java/bisq/desktop/main/MainView.java @@ -357,25 +357,23 @@ public class MainView extends InitializableView { settingsButtonWithBadge.getStyleClass().add("new"); navigation.addListener((viewPath, data) -> { - UserThread.execute(() -> { - if (viewPath.size() != 2 || viewPath.indexOf(MainView.class) != 0) - return; + if (viewPath.size() != 2 || viewPath.indexOf(MainView.class) != 0) + return; - Class viewClass = viewPath.tip(); - View view = viewLoader.load(viewClass); - contentContainer.getChildren().setAll(view.getRoot()); + Class viewClass = viewPath.tip(); + View view = viewLoader.load(viewClass); + contentContainer.getChildren().setAll(view.getRoot()); - try { - navButtons.getToggles().stream() - .filter(toggle -> toggle instanceof NavButton) - .filter(button -> viewClass == ((NavButton) button).viewClass) - .findFirst() - .orElseThrow(() -> new HavenoException("No button matching %s found", viewClass)) - .setSelected(true); - } catch (HavenoException e) { - navigation.navigateTo(MainView.class, MarketView.class, OfferBookChartView.class); - } - }); + try { + navButtons.getToggles().stream() + .filter(toggle -> toggle instanceof NavButton) + .filter(button -> viewClass == ((NavButton) button).viewClass) + .findFirst() + .orElseThrow(() -> new HavenoException("No button matching %s found", viewClass)) + .setSelected(true); + } catch (HavenoException e) { + navigation.navigateTo(MainView.class, MarketView.class, OfferBookChartView.class); + } }); VBox splashScreen = createSplashScreen(); diff --git a/desktop/src/main/java/bisq/desktop/main/MainViewModel.java b/desktop/src/main/java/bisq/desktop/main/MainViewModel.java index 996f84ecd8..5d065b6fa7 100644 --- a/desktop/src/main/java/bisq/desktop/main/MainViewModel.java +++ b/desktop/src/main/java/bisq/desktop/main/MainViewModel.java @@ -268,7 +268,7 @@ public class MainViewModel implements ViewModel, HavenoSetup.HavenoSetupListener setupDevDummyPaymentAccounts(); } - getShowAppScreen().set(true); + UserThread.execute(() -> getShowAppScreen().set(true)); // We only show the popup if the user has already set up any fiat account. For new users it is not a rule // change and for altcoins its not relevant.