Наладил сжатие файлов книг в /tmp

This commit is contained in:
Book Pauk
2019-01-21 18:09:50 +07:00
parent 2fd737a2a7
commit 8c85b7be37
6 changed files with 53 additions and 6 deletions

View File

@@ -57,8 +57,9 @@ class Reader {
async loadCachedBook(url, callback){
const options = {
onDownloadProgress: progress => {
const total = (progress.total ? progress.total : progress.loaded + 200000);
if (callback)
callback({state: 'loading', progress: Math.round((progress.loaded*100)/progress.total)});
callback({state: 'loading', progress: Math.round((progress.loaded*100)/total)});
}
}
//загрузка

View File

@@ -53,6 +53,7 @@ class ProgressPage extends Vue {
this.step = (state.step ? state.step : this.step);
this.totalSteps = (state.totalSteps > this.totalSteps ? state.totalSteps : this.totalSteps);
this.progress = state.progress || 0;
console.log(state);
}
get percentage() {