stoodkev / SteemPlus

SteemPlus is a lightweight browser extension adding new features to your Steemit/Busy experience: - Voting slider for minnows - Possibility to filter (by tag/resteem/reputation) and sort ( by date/payout/votes) - Switch between Busy Steemit and Steemd by keyboard shortcuts - Delegation of Steem Power directly from the wallet
GNU General Public License v3.0
27 stars 32 forks source link

[steemit.com] Posts on Feed shows undefined in place of vote count #185

Open ng-gist opened 5 years ago

ng-gist commented 5 years ago

Expected behavior

On steemit.com platform, Posts on feed should show vote counts.

Actual behavior

On steemit.com platform, SteemPlus Feed shows undefined for vote count.

How to reproduce

  1. Install and enable latest SteemPlus extension.
  2. Go to steemit.com and click on Feed from Top (Next to Promoted.)
  3. Notice undefined next to up carrot

image

Technical Analysis

feedplus.js line 167

list_posts.push(Posts(window.SteemPlus.Sanitize.postBodyShort(elt.body), elt.title, elt.hasOwnProperty("first_reblogged_by") ? elt.first_reblogged_by : '', elt.created, elt.pending_payout_value, 0, elt.net_votes, elt.author, JSON.parse(elt.json_metadata).hasOwnProperty("tags") ? JSON.parse(elt.json_metadata).tags : [elt.category], urlImage, elt.url, voted));

Change net_votes to active_votes.length

list_posts.push(Posts(window.SteemPlus.Sanitize.postBodyShort(elt.body), elt.title, elt.hasOwnProperty("first_reblogged_by") ? elt.first_reblogged_by : '', elt.created, elt.pending_payout_value, 0, elt.active_votes.length, elt.author, JSON.parse(elt.json_metadata).hasOwnProperty("tags") ? JSON.parse(elt.json_metadata).tags : [elt.category], urlImage, elt.url, voted));