Random typos etc

This commit is contained in:
Nils Maier 2020-08-29 23:49:48 +02:00
parent c540c1fc29
commit 3c644e615d
6 changed files with 23 additions and 22 deletions

View File

@ -667,7 +667,7 @@ locale.then(() => {
await DB.init();
}
catch (ex) {
console.error("dbinit", ex.toString(), ex.message, ex.stack, ex);
console.error("db init", ex.toString(), ex.message, ex.stack, ex);
}
await Prefs.set("last-run", new Date());

View File

@ -16,7 +16,7 @@ import {
DONE,
FORCABLE,
MISSING,
PAUSABLE,
PAUSEABLE,
PAUSED,
QUEUED,
RUNNING,
@ -235,7 +235,7 @@ export class Download extends BaseDownload {
}
async pause(retry?: boolean) {
if (!(PAUSABLE & this.state)) {
if (!(PAUSEABLE & this.state)) {
return;
}
@ -277,7 +277,7 @@ export class Download extends BaseDownload {
await downloads.cancel(id);
}
catch (ex) {
// ingored
// ignored
}
await new Promise(r => setTimeout(r, 1000));
try {
@ -285,7 +285,7 @@ export class Download extends BaseDownload {
}
catch (ex) {
console.error(id, ex.toString(), ex);
// ingored
// ignored
}
}
@ -399,7 +399,7 @@ export class Download extends BaseDownload {
}
}
updatefromSuggestion(state: any) {
updateFromSuggestion(state: any) {
const res: PrerollResults = {};
if (state.mime) {
res.mime = state.mime;

View File

@ -91,11 +91,11 @@ export class Manager extends EventEmitter {
}
Bus.onPort("manager", (port: Port) => {
const mport = new ManagerPort(this, port);
const managerPort = new ManagerPort(this, port);
port.on("disconnect", () => {
this.ports.delete(mport);
this.ports.delete(managerPort);
});
this.ports.add(mport);
this.ports.add(managerPort);
return true;
});
Limits.on("changed", () => {
@ -126,7 +126,7 @@ export class Manager extends EventEmitter {
// Do not wait for the scheduler
this.resetScheduler();
this.emit("inited");
this.emit("initialized");
setTimeout(() => this.checkMissing(), MISSING_TIMEOUT);
runtime.onUpdateAvailable.addListener(() => {
if (this.running.size) {
@ -171,7 +171,7 @@ export class Manager extends EventEmitter {
return;
}
try {
download.updatefromSuggestion(state);
download.updateFromSuggestion(state);
}
finally {
const suggestion = {filename: download.dest.full};
@ -358,8 +358,8 @@ export class Manager extends EventEmitter {
this.startNext().catch(console.error);
}
else if (newState === RUNNING) {
// Usually we already added it. Buit if a user uses the built-in
// download manager to resart
// Usually we already added it. But if a user uses the built-in
// download manager to restart
// a download, we have not, so make sure it is added either way
this.running.add(download);
}
@ -417,17 +417,18 @@ export class Manager extends EventEmitter {
sorted(sids: number[]) {
try {
// Construct new items
const csids = new Map(this.sids);
const currentSids = new Map(this.sids);
let items = mapFilterInSitu(sids, sid => {
const item = csids.get(sid);
const item = currentSids.get(sid);
if (!item) {
return null;
}
csids.delete(sid);
currentSids.delete(sid);
return item;
}, e => !!e);
if (csids.size) {
items = items.concat(sort(Array.from(csids.values()), i => i.position));
if (currentSids.size) {
items = items.concat(
sort(Array.from(currentSids.values()), i => i.position));
}
this.items = items;
this.setPositions();

View File

@ -12,5 +12,5 @@ export const RETRYING = 1 << 7;
export const RESUMABLE = PAUSED | CANCELED | RETRYING;
export const FORCABLE = PAUSED | QUEUED | CANCELED | RETRYING;
export const PAUSABLE = QUEUED | CANCELED | RUNNING | RETRYING;
export const PAUSEABLE = QUEUED | CANCELED | RUNNING | RETRYING;
export const CANCELABLE = QUEUED | RUNNING | PAUSED | DONE | MISSING | RETRYING;

View File

@ -790,7 +790,7 @@ export class DownloadTable extends VirtualTable {
const items = this.getSelectedItems();
const states = items.reduce((p, c) => p |= c.state, 0);
if (!(states & DownloadState.PAUSABLE)) {
if (!(states & DownloadState.PAUSEABLE)) {
this.pauseAction.disabled = true;
}
@ -828,7 +828,7 @@ export class DownloadTable extends VirtualTable {
}
pauseDownloads() {
const sids = this.getSelectedSids(DownloadState.PAUSABLE);
const sids = this.getSelectedSids(DownloadState.PAUSEABLE);
if (!sids.length) {
return;
}

View File

@ -665,7 +665,7 @@ addEventListener("DOMContentLoaded", async () => {
});
await saveCustomLocale(text);
if (confirm("Imported your file.\nWant to relaod the extension now?")) {
if (confirm("Imported your file.\nWant to reload the extension now?")) {
runtime.reload();
}
}