aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/popup.ts
diff options
context:
space:
mode:
authorAjay <[email protected]>2023-11-08 16:07:59 -0500
committerAjay <[email protected]>2023-11-08 16:07:59 -0500
commite722ded58a928989bb583ae266acf765c129592c (patch)
tree28d2dea746c1b764737775564e65ce10b01ef3d4 /src/popup.ts
parent6d37180d005f8f1c7691e0567ea4802425ca7569 (diff)
downloadSponsorBlock-e722ded58a928989bb583ae266acf765c129592c.tar.gz
SponsorBlock-e722ded58a928989bb583ae266acf765c129592c.zip
Add dearrow promo based on title and remove old one
Also refactor requests out to seperate file
Diffstat (limited to 'src/popup.ts')
-rw-r--r--src/popup.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/popup.ts b/src/popup.ts
index 41fb9210..21267afe 100644
--- a/src/popup.ts
+++ b/src/popup.ts
@@ -27,6 +27,7 @@ import GenericNotice from "./render/GenericNotice";
import { getErrorMessage, getFormattedTime } from "../maze-utils/src/formating";
import { StorageChangesObject } from "../maze-utils/src/config";
import { getHash } from "../maze-utils/src/hash";
+import { asyncRequestToServer, sendRequestToServer } from "./utils/requests";
const utils = new Utils();
@@ -295,7 +296,7 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
const values = ["userName", "viewCount", "minutesSaved", "vip", "permissions"];
- utils.asyncRequestToServer("GET", "/api/userInfo", {
+ asyncRequestToServer("GET", "/api/userInfo", {
publicUserID: await getHash(Config.config.userID),
values
}).then((res) => {
@@ -818,7 +819,7 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
PageElements.setUsernameStatus.style.display = "unset";
PageElements.setUsernameStatus.innerText = chrome.i18n.getMessage("Loading");
- utils.sendRequestToServer("POST", "/api/setUsername?userID=" + Config.config.userID + "&username=" + PageElements.usernameInput.value, function (response) {
+ sendRequestToServer("POST", "/api/setUsername?userID=" + Config.config.userID + "&username=" + PageElements.usernameInput.value, function (response) {
if (response.status == 200) {
//submitted
PageElements.submitUsername.style.display = "none";