From b38edd75f5142da515e46dbbc667162186a77653 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 17 Feb 2022 10:17:14 +0300 Subject: Do not allow to delete Telegram when it is the only social account --- src/main/java/com/juick/www/controllers/Settings.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/main/java/com/juick/www') diff --git a/src/main/java/com/juick/www/controllers/Settings.java b/src/main/java/com/juick/www/controllers/Settings.java index 8fefadc2..1dc5f1c3 100644 --- a/src/main/java/com/juick/www/controllers/Settings.java +++ b/src/main/java/com/juick/www/controllers/Settings.java @@ -248,7 +248,9 @@ public class Settings { result = "

Back

"; break; case "telegram-del": - telegramService.deleteTelegramUser(visitor.getUid()); + if (userService.canDeleteTelegramUser(visitor)) { + telegramService.deleteTelegramUser(visitor.getUid()); + } result = "

Back

"; break; case "facebook-disable": -- cgit v1.2.3