Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show download progress #2

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading