diff --git a/app/js/controllers.js b/app/js/controllers.js index 1e1c1131..159f5fa4 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -3648,9 +3648,11 @@ angular.module('myApp.controllers', ['myApp.i18n']) } $scope.leaveChannel = function () { - MtpApiManager.invokeApi('channels.leaveChannel', { - channel: AppChatsManager.getChannelInput($scope.chatID) - }).then(onChatUpdated) + return ErrorService.confirm({type: $scope.isMegagroup ? 'MEGAGROUP_LEAVE' : 'CHANNEL_LEAVE'}).then(function () { + MtpApiManager.invokeApi('channels.leaveChannel', { + channel: AppChatsManager.getChannelInput($scope.chatID) + }).then(onChatUpdated) + }) } $scope.deleteChannel = function () { diff --git a/app/js/locales/en-us.json b/app/js/locales/en-us.json index 3cf04770..c6720e1c 100644 --- a/app/js/locales/en-us.json +++ b/app/js/locales/en-us.json @@ -216,6 +216,8 @@ "confirm_modal_update_reload": "A new version of Telegram Web has been downloaded. Launch it?", "confirm_modal_history_flush": "Are you sure? This can not be undone!", "confirm_modal_history_leave_flush_md": "Are you sure, you want to delete all message history and leave the group?\n\nThis action cannot be undone.", + "confirm_modal_leave_channel_md": "Are you sure, you want to leave this channel?\n\nThis action cannot be undone.", + "confirm_modal_leave_group_md": "Are you sure, you want to leave this group?\n\nThis action cannot be undone.", "confirm_modal_terminate_sessions": "Are you sure you want to log out all devices except for this one?", "confirm_modal_terminate_session": "Are you sure you want to log out this device?", "confirm_modal_clipboard_file_send": "Are you sure to send file(s) from clipboard?", diff --git a/app/partials/desktop/confirm_modal.html b/app/partials/desktop/confirm_modal.html index bf91f607..ea06200d 100644 --- a/app/partials/desktop/confirm_modal.html +++ b/app/partials/desktop/confirm_modal.html @@ -61,6 +61,8 @@
+
+