diff options
author | Ajay <[email protected]> | 2023-02-14 01:42:25 -0500 |
---|---|---|
committer | Ajay <[email protected]> | 2023-02-14 01:42:25 -0500 |
commit | 1d0ac86e5af9ae44302651cef416c94e8da724a4 (patch) | |
tree | e6d269917bc7ec3c6e531688b4b7f555ede778fb /src/utils | |
parent | 12c63b4ff92b82368df55f2c6a9d80b4b4ff608c (diff) | |
download | SponsorBlock-1d0ac86e5af9ae44302651cef416c94e8da724a4.tar.gz SponsorBlock-1d0ac86e5af9ae44302651cef416c94e8da724a4.zip |
Move get hash to shared lib
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/licenseKey.ts | 3 | ||||
-rw-r--r-- | src/utils/warnings.ts | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/utils/licenseKey.ts b/src/utils/licenseKey.ts index 77eca21d..67487faf 100644 --- a/src/utils/licenseKey.ts +++ b/src/utils/licenseKey.ts @@ -1,6 +1,7 @@ import Config from "../config"; import Utils from "../utils"; import * as CompileConfig from "../../config.json"; +import { getHash } from "@ajayyy/maze-utils/lib/hash"; const utils = new Utils(); @@ -53,7 +54,7 @@ export async function fetchingChaptersAllowed(): Promise<boolean> { // Check for free access if no license key, and it is the first time const result = await utils.asyncRequestToServer("GET", "/api/userInfo", { value: "freeChaptersAccess", - publicUserID: await utils.getHash(Config.config.userID) + publicUserID: await getHash(Config.config.userID) }); try { diff --git a/src/utils/warnings.ts b/src/utils/warnings.ts index 0ff3980c..f4618009 100644 --- a/src/utils/warnings.ts +++ b/src/utils/warnings.ts @@ -1,4 +1,5 @@ import { objectToURI } from "@ajayyy/maze-utils"; +import { getHash } from "@ajayyy/maze-utils/lib/hash"; import Config from "../config"; import GenericNotice, { NoticeOptions } from "../render/GenericNotice"; import { ContentContainer } from "../types"; @@ -13,7 +14,7 @@ export interface ChatConfig { export async function openWarningDialog(contentContainer: ContentContainer): Promise<void> { const userInfo = await utils.asyncRequestToServer("GET", "/api/userInfo", { - publicUserID: await utils.getHash(Config.config.userID), + publicUserID: await getHash(Config.config.userID), values: ["warningReason"] }); @@ -21,7 +22,7 @@ export async function openWarningDialog(contentContainer: ContentContainer): Pro const warningReason = JSON.parse(userInfo.responseText)?.warningReason; const userNameData = await utils.asyncRequestToServer("GET", "/api/getUsername?userID=" + Config.config.userID); const userName = userNameData.ok ? JSON.parse(userNameData.responseText).userName : ""; - const publicUserID = await utils.getHash(Config.config.userID); + const publicUserID = await getHash(Config.config.userID); let notice: GenericNotice = null; const options: NoticeOptions = { |