Browse Source

Fixed multiple open tabs warning

master
Igor Zhukov 10 years ago
parent
commit
503aa4bd16
  1. 4
      app/js/lib/mtproto_wrapper.js
  2. 2
      app/js/locales/en-us.json
  3. 2
      app/partials/desktop/error_modal.html

4
app/js/lib/mtproto_wrapper.js

@ -613,7 +613,7 @@ angular.module('izhukov.mtproto.wrapper', ['izhukov.utils', 'izhukov.mtproto'])
}; };
}) })
.service('MtpSingleInstanceService', function ($rootScope, $interval, Storage, AppRuntimeManager, IdleManager, ErrorService, MtpNetworkerFactory) { .service('MtpSingleInstanceService', function (_, $rootScope, $interval, Storage, AppRuntimeManager, IdleManager, ErrorService, MtpNetworkerFactory) {
var instanceID = nextRandomInt(0xFFFFFFFF); var instanceID = nextRandomInt(0xFFFFFFFF);
var started = false; var started = false;
@ -664,7 +664,7 @@ angular.module('izhukov.mtproto.wrapper', ['izhukov.utils', 'izhukov.mtproto'])
else if (idleInstance.time > time - 10000 && else if (idleInstance.time > time - 10000 &&
time > errorShowTime) { time > errorShowTime) {
ErrorService.show({error: {type: 'MULTIPLE_TABS_OPEN'}}); ErrorService.alert(_('error_modal_warning_title'), _('error_modal_multiple_open_tabs'));
errorShowTime += tsNow() + 60000; errorShowTime += tsNow() + 60000;
} }
} }

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

@ -225,7 +225,7 @@
"error_modal_flood_description": "You are performing too many actions. Please try again later.", "error_modal_flood_description": "You are performing too many actions. Please try again later.",
"error_modal_internal_description": "Internal server error occured. Please try again later.", "error_modal_internal_description": "Internal server error occured. Please try again later.",
"error_modal_tech_details": "Technical details here", "error_modal_tech_details": "Technical details here",
"error_modal_multiple_open_tabs": "Telegram Web doesn't support working in multiple tabs. Please close other app instances.", "error_modal_multiple_open_tabs": "Please close other Telegram app tabs.",
"head_new_group": "New Group", "head_new_group": "New Group",

2
app/partials/desktop/error_modal.html

@ -5,7 +5,6 @@
<div class="modal-body"> <div class="modal-body">
<h4 ng-if="error" class="modal_simple_header" ng-switch="error.type"> <h4 ng-if="error" class="modal_simple_header" ng-switch="error.type">
<span ng-switch-when="MULTIPLE_TABS_OPEN" my-i18n="error_modal_warning_title"></span>
<span ng-switch-default ng-switch="error.code"> <span ng-switch-default ng-switch="error.code">
<span ng-switch-when="400" my-i18n="error_modal_bad_request_title"></span> <span ng-switch-when="400" my-i18n="error_modal_bad_request_title"></span>
<span ng-switch-when="401" my-i18n="error_modal_unauthorized_title"></span> <span ng-switch-when="401" my-i18n="error_modal_unauthorized_title"></span>
@ -36,7 +35,6 @@
<span ng-switch-when="PHONEBOOK_GET_CONTACTS_FAILED" my-i18n="error_modal_phonebook_required_description"></span> <span ng-switch-when="PHONEBOOK_GET_CONTACTS_FAILED" my-i18n="error_modal_phonebook_required_description"></span>
<span ng-switch-when="USERNAME_INVALID" my-i18n="error_modal_username_invalid_description"></span> <span ng-switch-when="USERNAME_INVALID" my-i18n="error_modal_username_invalid_description"></span>
<span ng-switch-when="USERNAME_OCCUPIED" my-i18n="error_modal_username_occupied_description"></span> <span ng-switch-when="USERNAME_OCCUPIED" my-i18n="error_modal_username_occupied_description"></span>
<span ng-switch-when="MULTIPLE_TABS_OPEN" my-i18n="error_modal_multiple_open_tabs"></span>
<div ng-switch-default ng-switch="error.code"> <div ng-switch-default ng-switch="error.code">

Loading…
Cancel
Save