Enabled IndexedDB for Safari 8.0.3+

This commit is contained in:
Igor Zhukov 2015-02-12 14:13:18 +03:00
parent 51a3fd6984
commit b9fced4f7e
2 changed files with 15 additions and 3 deletions

View File

@ -311,9 +311,17 @@ angular.module('izhukov.utils', [])
var dbVersion = 1;
var openDbPromise;
var storageIsAvailable = $window.indexedDB !== undefined &&
$window.IDBTransaction !== undefined &&
navigator.userAgent.indexOf('Safari') == -1;
// As of Safari 8.0 IndexedDB is REALLY slow, no point in it
$window.IDBTransaction !== undefined;
// IndexedDB was REALLY slow till Safari 8.0.3, no point in it
if (storageIsAvailable &&
navigator.userAgent.indexOf('Safari') != -1 &&
navigator.userAgent.indexOf('Chrome') == -1 &&
navigator.userAgent.match(/Version\/([67]|8.0.[012])/)
) {
storageIsAvailable = false;
}
var storeBlobsAvailable = storageIsAvailable || false;
function isAvailable () {

View File

@ -2057,6 +2057,9 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
notification.title = (fromUser.first_name || '') +
(fromUser.first_name && fromUser.last_name ? ' ' : '') +
(fromUser.last_name || '');
if (!notification.title) {
notification.title = fromUser.phone || _('conversation_unknown_user_raw');
}
notificationPhoto = fromPhoto;
@ -2814,6 +2817,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
break;
}
});
apiDoc.file_name = apiDoc.file_name || '';
};
function getDoc (docID) {