Skip to content

Commit

Permalink
🐛 Fix error when snippet cards trying to refresh their star count on …
Browse files Browse the repository at this point in the history
…mount
  • Loading branch information
theRealPadster committed Jan 20, 2022
1 parent 5ff314b commit 1cc053f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Card.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class Card extends react.Component {

async componentDidMount() {
// Refresh stars if on "Installed" tab with stars enabled
if (CONFIG.activeTab === "Installed" && CONFIG.visual.stars) {
if (CONFIG.activeTab === "Installed" && CONFIG.visual.stars && this.type !== "snippet") {
// https://docs.github.com/en/rest/reference/repos#get-a-repository
const url = `https://api.github.com/repos/${this.user}/${this.repo}`;
// TODO: This implementation could probably be improved.
Expand Down Expand Up @@ -363,7 +363,7 @@ class Card extends react.Component {

let detail = [];
// this.visual.type && detail.push(this.type);
if (this.type != "snippet" && this.visual.stars) {
if (this.type !== "snippet" && this.visual.stars) {
detail.push(`★ ${this.state.stars}`);
}
return react.createElement(Spicetify.ReactComponent.RightClickMenu || "div", {
Expand Down

0 comments on commit 1cc053f

Please sign in to comment.