diff --git a/lib/manager/port.ts b/lib/manager/port.ts index 7a50148..48e11c8 100644 --- a/lib/manager/port.ts +++ b/lib/manager/port.ts @@ -9,6 +9,8 @@ import { BaseDownload } from "./basedownload"; import { Manager } from "./man"; // eslint-disable-next-line no-unused-vars import { Port } from "../bus"; +// eslint-disable-next-line no-unused-vars +import { BaseItem } from "../item"; type SID = {sid: number}; type SIDS = { @@ -42,6 +44,9 @@ export class ManagerPort { port.on("prefs", () => { openPrefs(); }); + port.on("import", ({items}: {items: BaseItem[]}) => { + API.regular(items, []); + }); port.on("all", () => this.sendAll()); port.on("removeSids", this.onMsgRemoveSids); port.on("showSingle", async () => { diff --git a/windows/manager/table.ts b/windows/manager/table.ts index f374996..3d0def7 100644 --- a/windows/manager/table.ts +++ b/windows/manager/table.ts @@ -41,7 +41,6 @@ import { IconCache } from "../../lib/iconcache"; import * as imex from "../../lib/imex"; // eslint-disable-next-line no-unused-vars import { BaseItem } from "../../lib/item"; -import { API } from "../../lib/api"; const TREE_CONFIG_VERSION = 2; const RUNNING_TIMEOUT = 1000; @@ -1204,7 +1203,7 @@ export class DownloadTable extends VirtualTable { if (!items || !items.length) { return; } - API.regular(items, []); + PORT.post("import", {items}); }; reader.readAsText(picker.files[0], "utf-8"); };