Browse Source

Added confirm before leaving channel / supergroup

master
Igor Zhukov 9 years ago
parent
commit
3371e500cc
  1. 2
      app/js/controllers.js
  2. 2
      app/js/locales/en-us.json
  3. 2
      app/partials/desktop/confirm_modal.html

2
app/js/controllers.js

@ -3648,9 +3648,11 @@ angular.module('myApp.controllers', ['myApp.i18n'])
} }
$scope.leaveChannel = function () { $scope.leaveChannel = function () {
return ErrorService.confirm({type: $scope.isMegagroup ? 'MEGAGROUP_LEAVE' : 'CHANNEL_LEAVE'}).then(function () {
MtpApiManager.invokeApi('channels.leaveChannel', { MtpApiManager.invokeApi('channels.leaveChannel', {
channel: AppChatsManager.getChannelInput($scope.chatID) channel: AppChatsManager.getChannelInput($scope.chatID)
}).then(onChatUpdated) }).then(onChatUpdated)
})
} }
$scope.deleteChannel = function () { $scope.deleteChannel = function () {

2
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_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_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_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_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_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?", "confirm_modal_clipboard_file_send": "Are you sure to send file(s) from clipboard?",

2
app/partials/desktop/confirm_modal.html

@ -61,6 +61,8 @@
<div ng-switch-when="REVOKE_CHANNEL_INVITE_LINK" my-i18n="confirm_modal_revoke_channel_link"></div> <div ng-switch-when="REVOKE_CHANNEL_INVITE_LINK" my-i18n="confirm_modal_revoke_channel_link"></div>
<div ng-switch-when="CHANNEL_DELETE" my-i18n="confirm_modal_delete_channel_md"></div> <div ng-switch-when="CHANNEL_DELETE" my-i18n="confirm_modal_delete_channel_md"></div>
<div ng-switch-when="MEGAGROUP_DELETE" my-i18n="confirm_modal_delete_group_md"></div> <div ng-switch-when="MEGAGROUP_DELETE" my-i18n="confirm_modal_delete_group_md"></div>
<div ng-switch-when="CHANNEL_LEAVE" my-i18n="confirm_modal_leave_channel_md"></div>
<div ng-switch-when="MEGAGROUP_LEAVE" my-i18n="confirm_modal_leave_group_md"></div>
<div ng-switch-when="JUMP_EXT_URL" my-i18n="confirm_modal_jump_ext_url_md" class="confirm_modal_extlink_jump"> <div ng-switch-when="JUMP_EXT_URL" my-i18n="confirm_modal_jump_ext_url_md" class="confirm_modal_extlink_jump">
<my-i18n-param name="url"><strong ng-bind="url"></strong></my-i18n-param> <my-i18n-param name="url"><strong ng-bind="url"></strong></my-i18n-param>
</div> </div>

Loading…
Cancel
Save