Browse Source

Fixed session revoke handling, fixed undefined location, IM styles

master
Igor Zhukov 10 years ago
parent
commit
dd7d5d91ca
  1. 2
      app/css/app.css
  2. 4
      app/js/controllers.js
  3. 15
      app/js/directives.js
  4. 11
      app/js/lib/mtproto.js

2
app/css/app.css

@ -2206,7 +2206,7 @@ a.contacts_modal_contact:hover .contacts_modal_contact_status { @@ -2206,7 +2206,7 @@ a.contacts_modal_contact:hover .contacts_modal_contact_status {
cursor: pointer;
position: absolute;
width: 112px;
height: 50px;
height: 52px;
margin: -8px 0 0 -112px;
}
@media (min-width: 1024px) {

4
app/js/controllers.js

@ -300,7 +300,9 @@ angular.module('myApp.controllers', []) @@ -300,7 +300,9 @@ angular.module('myApp.controllers', [])
}, function (error) {
if (error.code == 401) {
$location.url('/login');
MtpApiManager.logOut()['finally'](function () {
$location.url('/login');
});
}
});
}

15
app/js/directives.js

@ -89,12 +89,16 @@ angular.module('myApp.directives', ['myApp.filters']) @@ -89,12 +89,16 @@ angular.module('myApp.directives', ['myApp.filters'])
return;
}
if (!headWrap) {
if (!headWrap || !headWrap.offsetHeight) {
headWrap = $('.tg_page_head')[0];
}
if (!footer || !footer.offsetHeight) {
footer = $('.im_page_footer')[0];
}
$(element).css({
height: $($window).height() - footer.offsetHeight - (headWrap ? headWrap.offsetHeight : 44) - 72
});
updateScroller();
}
@ -276,6 +280,12 @@ angular.module('myApp.directives', ['myApp.filters']) @@ -276,6 +280,12 @@ angular.module('myApp.directives', ['myApp.filters'])
});
}
if (!headWrap || !headWrap.offsetHeight) {
headWrap = $('.tg_page_head')[0];
}
if (!footer || !footer.offsetHeight) {
footer = $('.im_page_footer')[0];
}
var historyH = $($window).height() - panelWrap.offsetHeight - bottomPanelWrap.offsetHeight - (headWrap ? headWrap.offsetHeight : 44) - footer.offsetHeight;
$(historyWrap).css({
height: historyH
@ -496,7 +506,8 @@ angular.module('myApp.directives', ['myApp.filters']) @@ -496,7 +506,8 @@ angular.module('myApp.directives', ['myApp.filters'])
var cachedSrc = MtpApiFileManager.getCachedFile(
scope.thumb &&
scope.thumb.location &&
!scope.thumb.location.empty
!scope.thumb.location.empty &&
scope.thumb.location
);
if (cachedSrc) {

11
app/js/lib/mtproto.js

@ -2333,6 +2333,12 @@ factory('MtpApiManager', function (AppConfigManager, MtpAuthorizer, MtpNetworker @@ -2333,6 +2333,12 @@ factory('MtpApiManager', function (AppConfigManager, MtpAuthorizer, MtpNetworker
return mtpInvokeApi('auth.logOut').then(function () {
AppConfigManager.remove('dc', 'user_auth');
baseDcID = false;
}, function (error) {
AppConfigManager.remove('dc', 'user_auth');
if (error && error.code != 401) {
AppConfigManager.remove('dc' + baseDcID + '_auth_key');
}
baseDcID = false;
});
}
@ -2597,6 +2603,11 @@ factory('MtpApiFileManager', function (MtpApiManager, $q, $window) { @@ -2597,6 +2603,11 @@ factory('MtpApiFileManager', function (MtpApiManager, $q, $window) {
case 'inputAudioFileLocation':
return 'audio' + location.id;
}
if (!location.volume_id) {
console.trace('Empty location', location);
}
return location.volume_id + '_' + location.local_id + '_' + location.secret + '.jpg';
};

Loading…
Cancel
Save