diff --git a/src/app/torrent-page.js b/src/app/torrent-page.js index 1beeacc..bfaf995 100644 --- a/src/app/torrent-page.js +++ b/src/app/torrent-page.js @@ -226,7 +226,7 @@ export default class TorrentPage extends Page { } window.torrentSocket.on('trackerTorrentUpdate', this.trackerUpdate); - this.onVotes = async ({hash, good, bad}) => { + this.onVotes = async ({hash, good, bad, selfVote}) => { if(this.props.hash != hash) return; @@ -235,6 +235,7 @@ export default class TorrentPage extends Page { this.torrent.good = good; this.torrent.bad = bad; + this.state.voted = selfVote; this.forceUpdate(); } window.torrentSocket.on('votes', this.onVotes); diff --git a/src/background/api.js b/src/background/api.js index 34a46fb..ba1212d 100644 --- a/src/background/api.js +++ b/src/background/api.js @@ -139,7 +139,7 @@ module.exports = async ({ // get votes const {good, bad, selfVote} = await getVotes(hash) send('votes', { - hash, good, bad + hash, good, bad, selfVote }); }); }