Small fixes

This commit is contained in:
crschnick
2023-08-11 06:48:54 +00:00
parent 6666b5bd65
commit cdf205e705
2 changed files with 9 additions and 1 deletions

View File

@@ -34,10 +34,17 @@ public class UserReportComp extends SimpleComp {
private final ErrorEvent event;
private final Stage stage;
private boolean sent;
public UserReportComp(ErrorEvent event, Stage stage) {
this.event = event;
this.includedDiagnostics = new SimpleListProperty<>(FXCollections.observableArrayList());
this.stage = stage;
stage.setOnHidden(event1 -> {
if (!sent) {
ErrorAction.ignore().handle(event);
}
});
}
public static void show(ErrorEvent event) {
@@ -115,6 +122,7 @@ public class UserReportComp extends SimpleComp {
includedDiagnostics.forEach(event::addAttachment);
event.attachUserReport(text.get());
SentryErrorHandler.getInstance().handle(event);
sent = true;
stage.close();
}
}

View File

@@ -226,7 +226,7 @@ public abstract class DataStorage {
public synchronized List<DataStore> getUsableStores() {
return new ArrayList<>(getStoreEntries().stream()
.filter(entry -> !entry.isDisabled())
.filter(entry -> entry.getState().isUsable())
.map(DataStoreEntry::getStore)
.toList());
}