fix: size error when deleting torrents under certain conditions (#870)

This commit is contained in:
Rémi Marseault 2023-06-23 07:53:02 +02:00 committed by GitHub
parent 87038f48b9
commit 09828cb9ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,8 +23,9 @@ export default {
getTorrentCountString: (state: StoreState, getters: any) => () => {
if (state.selected_torrents.length) {
let selectedSize = state.selected_torrents
.map(hash => getters.getTorrent(hash))
.map(torrent => torrent.size | 0)
.map(getters.getTorrent)
.filter(torrent => torrent !== undefined)
.map(torrent => torrent.size)
.reduce((partialSum, newVal) => partialSum + newVal)
return i18n