Browse Source

Handle empty documents

master
Igor Zhukov 9 years ago
parent
commit
6e660681b8
  1. 12
      app/js/services.js

12
app/js/services.js

@ -1960,7 +1960,13 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -1960,7 +1960,13 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
break;
}
});
apiDoc.file_name = apiDoc.file_name || '';
apiDoc.mime_type = apiDoc.mime_type || '';
apiDoc.file_name = apiDoc.file_name || 'file';
if (apiDoc._ == 'documentEmpty') {
apiDoc.file_name = 'DELETED';
apiDoc.size = 0;
}
};
function getDoc (docID) {
@ -2063,6 +2069,10 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -2063,6 +2069,10 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
file_name: doc.file_name
};
if (doc._ == 'documentEmpty') {
return $q.reject();
}
if (historyDoc.downloaded && !toFileEntry) {
var cachedBlob = MtpApiFileManager.getCachedFile(inputFileLocation);
if (cachedBlob) {

Loading…
Cancel
Save