Browse Source

Added confirm before leaving channel / supergroup

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

8
app/js/controllers.js

@ -3648,9 +3648,11 @@ angular.module('myApp.controllers', ['myApp.i18n']) @@ -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 () {

2
app/js/locales/en-us.json

@ -216,6 +216,8 @@ @@ -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?",

2
app/partials/desktop/confirm_modal.html

@ -61,6 +61,8 @@ @@ -61,6 +61,8 @@
<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="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">
<my-i18n-param name="url"><strong ng-bind="url"></strong></my-i18n-param>
</div>

Loading…
Cancel
Save