Skip to content

Commit

Permalink
fix: Don’t render a zero when no claps have been given
Browse files Browse the repository at this point in the history
fixes #4
  • Loading branch information
ColinEberhardt committed May 17, 2018
1 parent 7a9ae03 commit 91f7fde
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/applause-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ class ApplauseButton extends HTMLCustomElement {

getClaps().then(claps => {
this.classList.remove("loading");
this._countElement.innerHTML = Number(claps);
const clapCount = Number(claps);
if (clapCount > 0) {
this._countElement.innerHTML = Number(claps);
}
});

this._connected = true;
Expand Down

0 comments on commit 91f7fde

Please sign in to comment.