Files
PayDirt/public/variables.js

18 lines
642 B
JavaScript
Raw Normal View History

2025-11-18 21:16:35 -05:00
import { postData } from "./client.js";
populateuserData();
async function populateuserData() {
const user = await postData("/getInfo", {}, window.localStorage.getItem("token"));
for (const [attribute, value] of Object.entries(user)) {
document.querySelectorAll(`.user-${attribute}`).forEach(element => {
if (attribute === "FirstName" && value === "") {
var text = element.textContent;
element.textContent = text.replace("%", user.Username);
}
var text = element.textContent;
element.textContent = text.replace("%", value);
});
}
}