Skip to content

Commit 1cc053f

Browse files
🐛 Fix error when snippet cards trying to refresh their star count on mount
1 parent 5ff314b commit 1cc053f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Card.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class Card extends react.Component {
9494

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

364364
let detail = [];
365365
// this.visual.type && detail.push(this.type);
366-
if (this.type != "snippet" && this.visual.stars) {
366+
if (this.type !== "snippet" && this.visual.stars) {
367367
detail.push(`★ ${this.state.stars}`);
368368
}
369369
return react.createElement(Spicetify.ReactComponent.RightClickMenu || "div", {

0 commit comments

Comments
 (0)