mirror of
https://github.com/haveno-dex/haveno.git
synced 2024-12-22 19:49:32 +00:00
fix jfx error in MainView
This commit is contained in:
parent
7e898ba23d
commit
2f0ea48a31
1 changed files with 16 additions and 15 deletions
|
@ -352,23 +352,24 @@ public class MainView extends InitializableView<StackPane, MainViewModel> {
|
||||||
settingsButtonWithBadge.getStyleClass().add("new");
|
settingsButtonWithBadge.getStyleClass().add("new");
|
||||||
|
|
||||||
navigation.addListener((viewPath, data) -> {
|
navigation.addListener((viewPath, data) -> {
|
||||||
if (viewPath.size() != 2 || viewPath.indexOf(MainView.class) != 0)
|
UserThread.execute(() -> {
|
||||||
return;
|
if (viewPath.size() != 2 || viewPath.indexOf(MainView.class) != 0) return;
|
||||||
|
|
||||||
Class<? extends View> viewClass = viewPath.tip();
|
Class<? extends View> viewClass = viewPath.tip();
|
||||||
View view = viewLoader.load(viewClass);
|
View view = viewLoader.load(viewClass);
|
||||||
contentContainer.getChildren().setAll(view.getRoot());
|
contentContainer.getChildren().setAll(view.getRoot());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
navButtons.getToggles().stream()
|
navButtons.getToggles().stream()
|
||||||
.filter(toggle -> toggle instanceof NavButton)
|
.filter(toggle -> toggle instanceof NavButton)
|
||||||
.filter(button -> viewClass == ((NavButton) button).viewClass)
|
.filter(button -> viewClass == ((NavButton) button).viewClass)
|
||||||
.findFirst()
|
.findFirst()
|
||||||
.orElseThrow(() -> new HavenoException("No button matching %s found", viewClass))
|
.orElseThrow(() -> new HavenoException("No button matching %s found", viewClass))
|
||||||
.setSelected(true);
|
.setSelected(true);
|
||||||
} catch (HavenoException e) {
|
} catch (HavenoException e) {
|
||||||
navigation.navigateTo(MainView.class, MarketView.class, OfferBookChartView.class);
|
navigation.navigateTo(MainView.class, MarketView.class, OfferBookChartView.class);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
VBox splashScreen = createSplashScreen();
|
VBox splashScreen = createSplashScreen();
|
||||||
|
|
Loading…
Reference in a new issue