mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2024-11-10 09:07:45 +01:00
Formatting
This commit is contained in:
parent
54013681ef
commit
c76f241b63
1 changed files with 16 additions and 13 deletions
29
src/popup.ts
29
src/popup.ts
|
@ -169,30 +169,33 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
|
|||
|
||||
utils.sendRequestToServer("GET", "/api/userInfo?value=userName&value=viewCount&value=minutesSaved&userID=" + Config.config.userID, (res) => {
|
||||
if (res.status === 200) {
|
||||
const userInfo = JSON.parse(res.responseText)
|
||||
PageElements.usernameValue.innerText = userInfo.userName
|
||||
const viewCount = userInfo.viewCount
|
||||
const userInfo = JSON.parse(res.responseText);
|
||||
PageElements.usernameValue.innerText = userInfo.userName;
|
||||
|
||||
const viewCount = userInfo.viewCount;
|
||||
if (viewCount != 0) {
|
||||
if (viewCount > 1) {
|
||||
PageElements.sponsorTimesViewsDisplayEndWord.innerText = chrome.i18n.getMessage("Segments")
|
||||
PageElements.sponsorTimesViewsDisplayEndWord.innerText = chrome.i18n.getMessage("Segments");
|
||||
} else {
|
||||
PageElements.sponsorTimesViewsDisplayEndWord.innerText = chrome.i18n.getMessage("Segment")
|
||||
PageElements.sponsorTimesViewsDisplayEndWord.innerText = chrome.i18n.getMessage("Segment");
|
||||
}
|
||||
PageElements.sponsorTimesViewsDisplay.innerText = viewCount.toLocaleString()
|
||||
PageElements.sponsorTimesViewsContainer.style.display = "unset"
|
||||
PageElements.sponsorTimesViewsDisplay.innerText = viewCount.toLocaleString();
|
||||
PageElements.sponsorTimesViewsContainer.style.display = "unset";
|
||||
}
|
||||
showDonateWidget(viewCount)
|
||||
const minutesSaved = userInfo.minutesSaved
|
||||
|
||||
showDonateWidget(viewCount);
|
||||
|
||||
const minutesSaved = userInfo.minutesSaved;
|
||||
if (minutesSaved != 0) {
|
||||
if (minutesSaved != 1) {
|
||||
PageElements.sponsorTimesOthersTimeSavedEndWord.innerText = chrome.i18n.getMessage("minsLower")
|
||||
PageElements.sponsorTimesOthersTimeSavedEndWord.innerText = chrome.i18n.getMessage("minsLower");
|
||||
} else {
|
||||
PageElements.sponsorTimesOthersTimeSavedEndWord.innerText = chrome.i18n.getMessage("minLower")
|
||||
PageElements.sponsorTimesOthersTimeSavedEndWord.innerText = chrome.i18n.getMessage("minLower");
|
||||
}
|
||||
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
|
||||
if (Config.config.sponsorTimesContributed != undefined) {
|
||||
|
|
Loading…
Reference in a new issue