fix: destroy store correctly

This commit is contained in:
ThaUnknown 2024-08-05 18:49:30 +02:00
parent 4f9fbb8806
commit 11ccef2287

View file

@ -231,11 +231,12 @@ export default class TorrentClient extends WebTorrent {
return
}
localStorage.setItem('lastFinished', 'false')
if (this.torrents.length) await this.remove(this.torrents[0])
if (this.torrents.length) {
await this.remove(this.torrents[0], { destroyStore: !this.settings.torrentPersist })
}
const torrent = await this.add(data, {
private: this.settings.torrentPeX,
path: this.torrentPath || undefined,
destroyStoreOnDestroy: !this.settings.torrentPersist,
skipVerify,
announce,
deselect: this.settings.torrentStreamedDownload