This commit is contained in:
Richard Mikloš 2024-02-03 22:51:38 +01:00
parent 9fda1b9195
commit bd9ec07e55

@ -1,4 +1,6 @@
<script> <script>
const welcomeMsg = document.getElementById("welcomeMsg");
async function getUserInfo() { async function getUserInfo() {
const data = new URLSearchParams(); const data = new URLSearchParams();
data.append("action", "get_user_info"); data.append("action", "get_user_info");
@ -6,12 +8,12 @@
const result = await doAccountAction(data, null, null, true); const result = await doAccountAction(data, null, null, true);
if (result && result.Status === "Success") { if (result && result.Status === "Success") {
return UserInfo.FirstName; welcomeMsg.innerText = `Ahoj, ${UserInfo.FirstName}.`;
} }
} }
</script> </script>
<body class="dashboard"> <body class="dashboard">
<h1>Ahoj, <script>getUserInfo()</script></h1> <h1 id="welcomeMsg"></h1>
</body> </body>