Browse Source

Enabled IndexedDB for Safari 8.0.3+

master
Igor Zhukov 10 years ago
parent
commit
b9fced4f7e
  1. 14
      app/js/lib/ng_utils.js
  2. 4
      app/js/services.js

14
app/js/lib/ng_utils.js

@ -311,9 +311,17 @@ angular.module('izhukov.utils', []) @@ -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 () {

4
app/js/services.js

@ -2057,6 +2057,9 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -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']) @@ -2814,6 +2817,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
break;
}
});
apiDoc.file_name = apiDoc.file_name || '';
};
function getDoc (docID) {

Loading…
Cancel
Save