Show dialog, if follow/unfollow didn't work
This commit is contained in:
parent
f0d2a720ab
commit
9ef9841a19
|
@ -368,11 +368,28 @@ public class ThumbCell extends StackPane {
|
||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
try {
|
try {
|
||||||
if(follow) {
|
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 {
|
} else {
|
||||||
boolean unfollowed = model.unfollow();
|
boolean unfollowed = model.unfollow();
|
||||||
if(unfollowed) {
|
if(unfollowed) {
|
||||||
Platform.runLater(() -> thumbCellList.remove(ThumbCell.this));
|
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) {
|
} catch (Exception e1) {
|
||||||
|
|
Loading…
Reference in New Issue