Show dialog, if follow/unfollow didn't work

This commit is contained in:
0xboobface 2018-10-24 19:51:29 +02:00
parent f0d2a720ab
commit 9ef9841a19
1 changed files with 18 additions and 1 deletions

View File

@ -368,11 +368,28 @@ public class ThumbCell extends StackPane {
new Thread(() -> {
try {
if(follow) {
model.follow();
boolean followed = model.follow();
if(!followed) {
Platform.runLater(() -> {
Alert alert = new AutosizeAlert(Alert.AlertType.ERROR);
alert.setTitle("Error");
alert.setHeaderText("Couldn't follow model");
alert.setContentText("");
alert.showAndWait();
});
}
} else {
boolean unfollowed = model.unfollow();
if(unfollowed) {
Platform.runLater(() -> thumbCellList.remove(ThumbCell.this));
} else {
Platform.runLater(() -> {
Alert alert = new AutosizeAlert(Alert.AlertType.ERROR);
alert.setTitle("Error");
alert.setHeaderText("Couldn't unfollow model");
alert.setContentText("");
alert.showAndWait();
});
}
}
} catch (Exception e1) {