Small bug fixes

This commit is contained in:
crschnick 2023-10-20 09:34:56 +00:00
parent 7c2b07f560
commit 4f86e6231b
4 changed files with 10 additions and 11 deletions

View file

@ -43,11 +43,11 @@ public class GuiMode extends PlatformMode {
@Override
public void onSwitchFrom() {
super.onSwitchFrom();
PlatformThread.runLaterIfNeededBlocking(() -> {
TrackEvent.info("mode", "Closing windows");
Stage.getWindows().stream().toList().forEach(w -> w.hide());
Stage.getWindows().stream().toList().forEach(w -> {
w.hide();
});
});
}
}

View file

@ -20,7 +20,6 @@ public abstract class PlatformMode extends OperationMode {
@Override
public void onSwitchTo() throws Throwable {
if (App.getApp() != null) {
StoreViewState.init();
return;
}
@ -58,15 +57,11 @@ public abstract class PlatformMode extends OperationMode {
StoreViewState.init();
}
@Override
public void onSwitchFrom() {
StoreViewState.reset();
}
@Override
public void finalTeardown() throws Throwable {
TrackEvent.info("mode", "Shutting down platform components");
onSwitchFrom();
StoreViewState.reset();
PlatformState.teardown();
TrackEvent.info("mode", "Platform shutdown finished");
BACKGROUND.finalTeardown();

View file

@ -33,7 +33,6 @@ public class TrayMode extends PlatformMode {
@Override
public void onSwitchFrom() {
super.onSwitchFrom();
if (AppTray.get() != null) {
TrackEvent.info("mode", "Closing tray");
PlatformThread.runLaterIfNeededBlocking(() -> AppTray.get().hide());

View file

@ -27,7 +27,12 @@ public class UnlockAlert {
alert.setHeaderText(AppI18n.get("unlockAlertHeader"));
alert.setAlertType(Alert.AlertType.CONFIRMATION);
var p1 = new SecretFieldComp(pw).createRegion();
var p1 = new SecretFieldComp(pw) {
@Override
protected SecretValue encrypt(char[] c) {
return SecretHelper.encryptInPlace(c);
}
}.createRegion();
p1.setStyle("-fx-border-width: 1px");
var content = new VBox(p1);