Skip to content

Commit

Permalink
show download progress
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanVukovic99 authored and Kuuuube committed Jul 29, 2024
1 parent 2e50478 commit 5503f0c
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions ext/js/pages/settings/dictionary-import-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,11 @@ export class DictionaryImportController {
try {
const url = this._recommendedDictionaryQueue.shift();
if (!url) { continue; }
const file = await fetch(url.trim())
.then((res) => res.blob())
.then((blob) => {
return new File([blob], 'fileFromURL');
});
const importProgressTracker = new ImportProgressTracker(this._getFileImportSteps(), 1);

const importProgressTracker = new ImportProgressTracker(this._getUrlImportSteps(), 1);
const onProgress = importProgressTracker.onProgress.bind(importProgressTracker);
void this._importDictionaries(
this._arrayToAsyncGenerator([file]),
this._generateFilesFromUrls([url], onProgress),
importProgressTracker,
);
} catch (error) {
Expand Down

0 comments on commit 5503f0c

Please sign in to comment.