Fixed remaining time for torrents

This commit is contained in:
Kylart 2019-07-20 20:01:02 +02:00
parent 37114f3e68
commit 4497ce0625
1 changed files with 3 additions and 5 deletions

View File

@ -38,7 +38,6 @@ export default {
data: () => ({ data: () => ({
isPaused: false, isPaused: false,
creationDate: moment(),
timeRemaining: '' timeRemaining: ''
}), }),
@ -77,11 +76,10 @@ export default {
return return
} }
const endsIn = parseInt(Date.now() + torrent.timeRemaining)
this.timeRemaining = torrent.timeRemaining this.timeRemaining = torrent.timeRemaining
? 'Ends ' + this.creationDate ? 'Ends ' + moment(endsIn).fromNow()
.clone()
.add(torrent.timeRemaining)
.fromNow()
: 'Unknown time remaining...' : 'Unknown time remaining...'
}, },
actOnTorrent (action) { actOnTorrent (action) {