From 62b008e693afa37ba8135d5c16f7e318046efdae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dainius=20Dauk=C5=A1evi=C4=8Dius?= Date: Mon, 19 Oct 2020 21:24:13 +0300 Subject: [PATCH] remove TODO comments --- src/config.ts | 2 +- src/routes/getSkipSegments.ts | 3 +-- src/routes/shadowBanUser.ts | 1 - src/utils/webhookUtils.ts | 1 - 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/config.ts b/src/config.ts index beeb6ed..fa35214 100644 --- a/src/config.ts +++ b/src/config.ts @@ -40,7 +40,7 @@ addDefaults(config, { windowMs: 900000, max: 20, statusCode: 200, - message: "", // TODO TYPESCRIPT whats the msg? + message: "Too many views, please try again later", }, }, userCounterURL: null, diff --git a/src/routes/getSkipSegments.ts b/src/routes/getSkipSegments.ts index 34c668c..c91e004 100644 --- a/src/routes/getSkipSegments.ts +++ b/src/routes/getSkipSegments.ts @@ -76,9 +76,8 @@ function getWeightedRandomChoice(choices: any[], amountOfChoices: number) { let totalWeight = 0; choices = choices.map(choice => { //The 3 makes -2 the minimum votes before being ignored completely - //https://www.desmos.com/calculator/c1duhfrmts //this can be changed if this system increases in popularity. - const weight = Math.exp((choice.votes + 3)); // TODO TYPESCRIPT what was this 0.85? + const weight = Math.exp((choice.votes + 3)); totalWeight += weight; return {...choice, weight}; diff --git a/src/routes/shadowBanUser.ts b/src/routes/shadowBanUser.ts index 96084c4..4e2a218 100644 --- a/src/routes/shadowBanUser.ts +++ b/src/routes/shadowBanUser.ts @@ -55,7 +55,6 @@ export async function shadowBanUser(req: Request, res: Response) { } } } - // TODO TYPESCRIPT a lof unused code, wtf is happening else if (hashedIP) { //check to see if this user is already shadowbanned // let row = privateDB.prepare('get', "SELECT count(*) as userCount FROM shadowBannedIPs WHERE hashedIP = ?", [hashedIP]); diff --git a/src/utils/webhookUtils.ts b/src/utils/webhookUtils.ts index fdd215e..955107c 100644 --- a/src/utils/webhookUtils.ts +++ b/src/utils/webhookUtils.ts @@ -36,7 +36,6 @@ function dispatchEvent(scope: string, data: any): void { let scopes = webhook.scopes || []; if (!scopes.includes(scope.toLowerCase())) return; - // TODO TYPESCRIPT deprecated request.post(webhookURL, { json: data, headers: { "Authorization": authKey,