diff --git a/frontend/Web/communication.js b/frontend/Web/communication.js
index 6c12c84..15369a9 100644
--- a/frontend/Web/communication.js
+++ b/frontend/Web/communication.js
@@ -69,6 +69,8 @@ async function Request(req)
localStorage.setItem("operation_count", operation_count);
return response;
}
+
+var SessionReadyEvent = new Event('SessionReady');
(async () => {
if(session_token==null||outhentication_key==null||operation_count==null){
let tmp_channel=generateRandomString(10);
@@ -79,6 +81,7 @@ async function Request(req)
localStorage.setItem("session_token", session_token);
localStorage.setItem("outhentication_key", outhentication_key);
localStorage.setItem("operation_count", operation_count);
+ document.dispatchEvent(SessionReadyEvent);
}
})();
diff --git a/frontend/Web/index.html b/frontend/Web/index.html
index 005205e..e9fdeea 100644
--- a/frontend/Web/index.html
+++ b/frontend/Web/index.html
@@ -135,7 +135,7 @@
Logout
Close Session
Register
- Change Password
+ Change Password
Admin Panel
@@ -194,7 +194,9 @@
ChangeUsername(nm+" [Admin]");
}
}
- UpdateUserInfo();
+ document.addEventListener('SessionReady', async () => {
+ await UpdateUserInfo();
+ });