fixed file downloads for chrome app
This commit is contained in:
parent
7a54967e92
commit
d31f4f0476
@ -467,6 +467,14 @@ angular.module('izhukov.mtproto.wrapper', ['izhukov.utils', 'izhukov.mtproto'])
|
||||
writeFileDeferred;
|
||||
if (fileWriter.length) {
|
||||
startOffset = fileWriter.length;
|
||||
if (startOffset >= size) {
|
||||
if (toFileEntry) {
|
||||
deferred.resolve(fileWriter.finalize());
|
||||
} else {
|
||||
deferred.resolve(cachedDownloads[fileName] = fileWriter.finalize());
|
||||
}
|
||||
return;
|
||||
}
|
||||
fileWriter.seek(startOffset);
|
||||
deferred.notify({done: startOffset, total: size});
|
||||
}
|
||||
|
@ -2855,11 +2855,13 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
|
||||
});
|
||||
|
||||
downloadPromise.then(function (blob) {
|
||||
FileManager.getFileCorrectUrl(blob, doc.mime_type).then(function (url) {
|
||||
historyDoc.url = $sce.trustAsResourceUrl(url);
|
||||
})
|
||||
delete historyDoc.progress;
|
||||
historyDoc.downloaded = true;
|
||||
if (blob) {
|
||||
FileManager.getFileCorrectUrl(blob, doc.mime_type).then(function (url) {
|
||||
historyDoc.url = $sce.trustAsResourceUrl(url);
|
||||
})
|
||||
historyDoc.downloaded = true;
|
||||
}
|
||||
console.log('file save done');
|
||||
}, function (e) {
|
||||
console.log('document download failed', e);
|
||||
|
Loading…
x
Reference in New Issue
Block a user