mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-07 20:17:05 +03:00
Show submission count from server
This commit is contained in:
14
src/popup.ts
14
src/popup.ts
@@ -303,7 +303,7 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
|
|||||||
PageElements.showNoticeAgain.style.display = "unset";
|
PageElements.showNoticeAgain.style.display = "unset";
|
||||||
}
|
}
|
||||||
|
|
||||||
const values = ["userName", "viewCount", "minutesSaved", "vip", "permissions"];
|
const values = ["userName", "viewCount", "minutesSaved", "vip", "permissions", "segmentCount"];
|
||||||
|
|
||||||
asyncRequestToServer("GET", "/api/userInfo", {
|
asyncRequestToServer("GET", "/api/userInfo", {
|
||||||
publicUserID: await getHash(Config.config.userID),
|
publicUserID: await getHash(Config.config.userID),
|
||||||
@@ -336,16 +336,18 @@ 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 contributed and display it to thank them
|
||||||
|
PageElements.sponsorTimesContributionsDisplay.innerText = Math.max(Config.config.sponsorTimesContributed ?? 0, userInfo.segmentCount).toLocaleString();
|
||||||
|
PageElements.sponsorTimesContributionsContainer.classList.remove("hidden");
|
||||||
|
|
||||||
|
PageElements.sponsorTimesOthersTimeSavedEndWord.innerText = chrome.i18n.getMessage("minsLower");
|
||||||
|
|
||||||
Config.config.isVip = userInfo.vip;
|
Config.config.isVip = userInfo.vip;
|
||||||
Config.config.permissions = userInfo.permissions;
|
Config.config.permissions = userInfo.permissions;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//get the amount of times this user has contributed and display it to thank them
|
|
||||||
if (Config.config.sponsorTimesContributed != undefined) {
|
|
||||||
PageElements.sponsorTimesContributionsDisplay.innerText = Config.config.sponsorTimesContributed.toLocaleString();
|
|
||||||
PageElements.sponsorTimesContributionsContainer.classList.remove("hidden");
|
|
||||||
}
|
|
||||||
|
|
||||||
//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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user