From b9aef94e5a278815872ff3e490071e51660f9079 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Fri, 16 Jan 2015 14:43:27 +0300 Subject: [PATCH] Improved messages delete Closes #620 --- app/js/controllers.js | 10 +++++++--- app/js/locales/en-us.json | 2 ++ app/partials/desktop/confirm_modal.html | 6 ++++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/app/js/controllers.js b/app/js/controllers.js index c71becca..d0da1e1c 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -1239,9 +1239,13 @@ angular.module('myApp.controllers', ['myApp.i18n']) angular.forEach($scope.selectedMsgs, function (t, messageID) { selectedMessageIDs.push(messageID); }); - AppMessagesManager.deleteMessages(selectedMessageIDs).then(function () { - selectedCancel(); - }); + if (selectedMessageIDs.length) { + ErrorService.confirm({type: 'MESSAGES_DELETE', count: selectedMessageIDs.length}).then(function () { + AppMessagesManager.deleteMessages(selectedMessageIDs).then(function () { + selectedCancel(); + }); + }); + } } } diff --git a/app/js/locales/en-us.json b/app/js/locales/en-us.json index 69d5da4e..3f9fe63f 100644 --- a/app/js/locales/en-us.json +++ b/app/js/locales/en-us.json @@ -132,6 +132,7 @@ "confirm_modal_clipboard_file_send": "Are you sure to send file(s) from clipboard?", "confirm_modal_clipboard_X_files_send": "{'one': 'Are you sure to send file from clipboard?', 'other': 'Are you sure to send {} files from clipboard?'}", "confirm_modal_message_delete": "Are you sure you want to delete the message?", + "confirm_modal_X_messages_delete": "{'one': 'Are you sure you want to delete the message?', 'other': 'Are you sure you want to delete {} messages?'}", "confirm_modal_photo_delete": "Are you sure you want to delete the photo?", "confirm_modal_contacts_import": "Telegram will now sync your contacts in order to find your friends.", "confirm_modal_login_phone_correct": "Is this phone number correct?", @@ -149,6 +150,7 @@ "confirm_modal_clipboard_files_send_submit": "Send", "confirm_modal_clipboard_file_send_submit": "Send", "confirm_modal_message_delete_submit": "Delete", + "confirm_modal_messages_delete_submit": "Delete", "confirm_modal_photo_delete_submit": "Delete", "confirm_modal_forward_message_submit": "Forward message", "confirm_modal_share_photo_submit": "Forward photo", diff --git a/app/partials/desktop/confirm_modal.html b/app/partials/desktop/confirm_modal.html index 6e1ec48f..49ca89b4 100644 --- a/app/partials/desktop/confirm_modal.html +++ b/app/partials/desktop/confirm_modal.html @@ -15,6 +15,11 @@ + + + +
@@ -56,6 +61,7 @@ +