Use segment count from the API

This commit is contained in:
Ajay Ramachandran
2021-07-06 01:35:39 -04:00
parent 584cfd4ff8
commit b066945331

View File

@@ -168,12 +168,9 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
PageElements.usernameValue.innerText = userInfo.userName; PageElements.usernameValue.innerText = userInfo.userName;
//get the amount of times this user has contributed and display it to thank them PageElements.sponsorTimesContributionsDisplay.innerText = userInfo.segmentCount.toLocaleString();
if (Config.config.sponsorTimesContributed != undefined) {
PageElements.sponsorTimesContributionsDisplay.innerText = Config.config.sponsorTimesContributed.toLocaleString();
PageElements.sponsorTimesContributionsContainer.classList.remove("hidden"); PageElements.sponsorTimesContributionsContainer.classList.remove("hidden");
//get the userID
const viewCount = userInfo.viewCount; const viewCount = userInfo.viewCount;
if (viewCount != 0) { if (viewCount != 0) {
if (viewCount > 1) { if (viewCount > 1) {
@@ -197,7 +194,6 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
PageElements.sponsorTimesOthersTimeSavedDisplay.innerText = getFormattedHours(minutesSaved); PageElements.sponsorTimesOthersTimeSavedDisplay.innerText = getFormattedHours(minutesSaved);
} }
} }
}
//get the amount of times this user has skipped a sponsor //get the amount of times this user has skipped a sponsor
if (Config.config.skipCount != undefined) { if (Config.config.skipCount != undefined) {