From 0e66071deffa48dcf963a60af921a2a738e115e6 Mon Sep 17 00:00:00 2001 From: Cory LaViska Date: Wed, 11 Nov 2020 16:52:02 -0500 Subject: [PATCH] Fix github rate limit issue --- docs/assets/plugins/metadata/metadata.js | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/docs/assets/plugins/metadata/metadata.js b/docs/assets/plugins/metadata/metadata.js index fd3d8ffcc..066260c58 100644 --- a/docs/assets/plugins/metadata/metadata.js +++ b/docs/assets/plugins/metadata/metadata.js @@ -217,18 +217,6 @@ }); } - function getShortNumber(value) { - const suffixes = ['', 'k', 'm', 'b', 't']; - const index = Math.floor(('' + value).length / 3); - let shortValue = parseFloat((index !== 0 ? (value / Math.pow(1000, index)) : value).toPrecision(2)); - - if (shortValue % 1 !== 0) { - shortValue = shortValue.toFixed(1); - } - - return shortValue + suffixes[index]; - } - function getDocsTagsObject(docsTags) { let tags = {}; @@ -270,14 +258,6 @@ `; target.appendChild(buttons); - }) - .then(() => { - fetch('https://api.github.com/repos/shoelace-style/shoelace') - .then(res => res.json()) - .then(json => { - const count = getShortNumber(json.stargazers_count); - [...document.querySelectorAll('.github-star-count')].map(stars => stars.textContent = count); - }); }); });