reset selection index everytime window is shown

Signed-off-by: Armin Schrenk <armin.schrenk@skymatic.de>
This commit is contained in:
Armin Schrenk
2025-12-21 12:32:35 +01:00
parent 2aff02a186
commit 05a41a625c

View File

@@ -75,14 +75,13 @@ public class NotificationController implements FxController {
@FXML
public void initialize() {
window.setOnShowing(_ -> selectionIndex.set(0));
selectionIndex.addListener((_, _, n) -> {
if (!events.isEmpty()) {
selectedEvent.setValue(events.get(n.intValue()));
}
});
selectedEvent.addListener(this::selectTexts);
selectionIndex.setValue(0);
}
private void selectTexts(ObservableValue<? extends VaultEvent> observable, VaultEvent oldEvent, VaultEvent newEvent) {