Browse Source

Improved confirm

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

2
app/js/controllers.js

@ -1047,7 +1047,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) @@ -1047,7 +1047,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
})
.controller('AppImHistoryController', function ($scope, $location, $timeout, $modal, $rootScope, MtpApiManager, AppUsersManager, AppChatsManager, AppMessagesManager, AppPeersManager, ApiUpdatesManager, PeersSelectService, IdleManager, StatusManager, NotificationsManager, ErrorService) {
.controller('AppImHistoryController', function ($scope, $location, $timeout, $modal, $rootScope, MtpApiManager, AppUsersManager, AppChatsManager, AppMessagesManager, AppPeersManager, ApiUpdatesManager, PeersSelectService, IdleManager, StatusManager, NotificationsManager, ErrorService, GeoLocationManager) {
$scope.$watchCollection('curDialog', applyDialogSelect);

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

@ -235,6 +235,9 @@ @@ -235,6 +235,9 @@
"confirm_modal_delete_group_md": "Are you sure you want to delete this group?\n\nAll members will be removed and all messages will be lost.",
"confirm_modal_jump_ext_url_md": "Open this link?\n\n{url}",
"confirm_modal_migrate_supergroup_md": "Please note that group members will need to update their Telegram apps to the latest version to see your supergroup.\n\nAre you sure you want to upgrade this group?",
"confirm_modal_bot_access_phone": "Do you want?",
"confirm_modal_bot_access_geo": "Do you want?",
"confirm_modal_bot_access_geo_inline": "Do you want?",
"confirm_modal_are_u_sure": "Are you sure?",

5
app/js/services.js

@ -2462,14 +2462,11 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -2462,14 +2462,11 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
};
if (bot.pFlags.bot_inline_geo) {
return checkGeoLocationAccess(peerID).then(function () {
// console.log('bot has access');
return GeoLocationManager.getPosition().then(function (coords) {
resolvedBot.geo = coords;
console.log('got position', resolvedBot);
return qSync.when(resolvedBot);
});
})['catch'](function () {
console.log('resolve', resolvedBot);
return qSync.when(resolvedBot);
})
}
@ -2764,7 +2761,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -2764,7 +2761,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
return true;
}
return ErrorService.confirm({
type: 'BOT_ACCESS_GEO'
type: 'BOT_ACCESS_GEO_INLINE'
}).then(function () {
var setHash = {};
setHash[key] = {granted: true, time: tsNow()};

3
app/partials/desktop/confirm_modal.html

@ -63,6 +63,9 @@ @@ -63,6 +63,9 @@
<my-i18n-param name="url"><strong ng-bind="url"></strong></my-i18n-param>
</div>
<div ng-switch-when="SUPERGROUP_MIGRATE" my-i18n="confirm_modal_migrate_supergroup_md"></div>
<div ng-switch-when="BOT_ACCESS_PHONE" my-i18n="confirm_modal_bot_access_phone"></div>
<div ng-switch-when="BOT_ACCESS_GEO" my-i18n="confirm_modal_bot_access_geo"></div>
<div ng-switch-when="BOT_ACCESS_GEO_INLINE" my-i18n="confirm_modal_bot_access_geo_inline"></div>

Loading…
Cancel
Save