From 9ef9841a19795be6a764c6eeea0dcdb881612a2e Mon Sep 17 00:00:00 2001 From: 0xboobface <0xboobface@gmail.com> Date: Wed, 24 Oct 2018 19:51:29 +0200 Subject: [PATCH] Show dialog, if follow/unfollow didn't work --- src/main/java/ctbrec/ui/ThumbCell.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/main/java/ctbrec/ui/ThumbCell.java b/src/main/java/ctbrec/ui/ThumbCell.java index af4dd4de..64342f3c 100644 --- a/src/main/java/ctbrec/ui/ThumbCell.java +++ b/src/main/java/ctbrec/ui/ThumbCell.java @@ -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) {