Browse Source

Improved PUSH handling

master
Igor Zhukov 7 years ago
parent
commit
5eb3d5344c
  1. 3
      app/js/lib/ng_utils.js
  2. 2
      app/js/lib/schema.tl
  3. 11
      app/js/services.js

3
app/js/lib/ng_utils.js

@ -1029,6 +1029,9 @@ angular.module('izhukov.utils', []) @@ -1029,6 +1029,9 @@ angular.module('izhukov.utils', [])
hidden = 'webkitHidden'
visibilityChange = 'webkitvisibilitychange'
}
if (!Config.Mobile) {
visibilityChange = ''
}
return {
start: start

2
app/js/lib/schema.tl

@ -833,7 +833,7 @@ auth.resendCode#3ef1a9bf phone_number:string phone_code_hash:string = auth.SentC @@ -833,7 +833,7 @@ auth.resendCode#3ef1a9bf phone_number:string phone_code_hash:string = auth.SentC
auth.cancelCode#1f040578 phone_number:string phone_code_hash:string = Bool;
auth.dropTempAuthKeys#8e48a188 except_auth_keys:Vector<long> = Bool;
account.registerDevice#f75874d1 token_type:int token:string other_uids:Vector<int> = Bool;
account.registerDevice#01280460 token_type:int token:string app_sandbox:Bool other_uids:Vector<int> = Bool;
account.unregisterDevice#3076c4bf token_type:int token:string other_uids:Vector<int> = Bool;
account.updateNotifySettings#84be5b93 peer:InputNotifyPeer settings:InputPeerNotifySettings = Bool;
account.getNotifySettings#12b3ad31 peer:InputNotifyPeer = PeerNotifySettings;

11
app/js/services.js

@ -3398,6 +3398,8 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -3398,6 +3398,8 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
$rootScope.$broadcast('stateSynchronized')
updatesState.syncLoading = false
}
}, function () {
updatesState.syncLoading = false
})
}
@ -4083,6 +4085,14 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -4083,6 +4085,14 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
if ('Notification' in window) {
try {
if (data.tag) {
angular.forEach(notificationsShown, function (notification) {
if (notification &&
notification.tag == data.tag) {
notification.hidden = true
}
})
}
notification = new Notification(data.title, {
icon: data.image || '',
body: data.message || '',
@ -4160,6 +4170,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -4160,6 +4170,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
}
try {
if (notification.close) {
notification.hidden = true
notification.close()
}
else if (notificationsMsSiteMode &&

Loading…
Cancel
Save