Move get hash to shared lib

This commit is contained in:
Ajay
2023-02-14 01:42:25 -05:00
parent 12c63b4ff9
commit 1d0ac86e5a
10 changed files with 28 additions and 38 deletions

View File

@@ -15,6 +15,7 @@ import KeybindComponent from "./components/options/KeybindComponent";
import { showDonationLink } from "./utils/configUtils";
import { localizeHtmlPage } from "./utils/pageUtils";
import { StorageChangesObject } from "@ajayyy/maze-utils/lib/config";
import { getHash } from "@ajayyy/maze-utils/lib/hash";
const utils = new Utils();
let embed = false;
@@ -532,7 +533,7 @@ function activatePrivateTextChange(element: HTMLElement) {
case "userID":
if (Config.config[option]) {
utils.asyncRequestToServer("GET", "/api/userInfo", {
publicUserID: utils.getHash(Config.config[option]),
publicUserID: getHash(Config.config[option]),
values: ["warnings", "banned"]
}).then((result) => {
const userInfo = JSON.parse(result.responseText);