Skip to content

Commit 550309c

Browse files
feat: destroy torrent properly
1 parent a075630 commit 550309c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/argo-shared-archive-list.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,9 @@ export class ArgoSharedArchiveList extends LitElement {
270270
const record = this.sharedArchives.find((a) => a.id === id);
271271
if (!record) return;
272272
const torrent = client.get(record.magnetURI);
273-
if (torrent) torrent.destroy();
273+
if (torrent) {
274+
await new Promise<void>((resolve) => torrent.destroy(() => resolve()));
275+
}
274276

275277
const all = this.sharedArchives.filter((a) => a.id !== id);
276278
await setSharedArchives(all);

0 commit comments

Comments
 (0)