From ae690f0c6569f84591b1a9578079ac0c26d1cad8 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Thu, 9 Apr 2020 14:03:13 -0400 Subject: [PATCH] Renamed new request function --- src/content.ts | 4 ++-- src/utils.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/content.ts b/src/content.ts index c2aada0b..e8fa1e52 100644 --- a/src/content.ts +++ b/src/content.ts @@ -600,7 +600,7 @@ function sponsorsLookup(id: string, channelIDPromise?) { categories.push(categorySelection.name); } - utils.requestToServer('GET', "/api/skipSegments", { + utils.asyncRequestToServer('GET', "/api/skipSegments", { videoID: id, categories }).then(async (response: Response) => { @@ -1578,7 +1578,7 @@ async function sendSubmitMessage(){ } if (Config.config.testingServer) { - let response = await utils.requestToServer("POST", "/api/skipSegments", { + let response = await utils.asyncRequestToServer("POST", "/api/skipSegments", { videoID: sponsorVideoID, userID: Config.config.userID, segments: sponsorTimesSubmitting diff --git a/src/utils.ts b/src/utils.ts index 1c8f0067..ce436d1e 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -276,7 +276,7 @@ class Utils { * @param address The address to add to the SponsorBlock server address * @param callback */ - async requestToServer(type: string, address: string, data = {}) { + async asyncRequestToServer(type: string, address: string, data = {}) { let serverAddress = Config.config.testingServer ? CompileConfig.testingServerAddress : Config.config.serverAddress; // If GET, convert JSON to parameters