summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcurly <curly@infernal.garden>2024-07-17 14:45:51 -0600
committercurly <curly@infernal.garden>2024-07-17 14:45:51 -0600
commit87b71455a88941f0285985c0f0566c95d6a81b9f (patch)
tree5640e094df03250563ebf6628482a2a93d78e3f9 /src
parentcc46857b4361c356e079b48d23a16b0fccaa7a61 (diff)
downloadpoko_web-87b71455a88941f0285985c0f0566c95d6a81b9f.tar.gz
poko_web-87b71455a88941f0285985c0f0566c95d6a81b9f.tar.bz2
poko_web-87b71455a88941f0285985c0f0566c95d6a81b9f.zip
if logged in; move to user page
Diffstat (limited to 'src')
-rw-r--r--src/main.js14
-rw-r--r--src/user/index.html2
2 files changed, 15 insertions, 1 deletions
diff --git a/src/main.js b/src/main.js
index f970abc..6f5b02a 100644
--- a/src/main.js
+++ b/src/main.js
@@ -309,6 +309,20 @@ async function update_name_form() {
}
+window.onload = async function() {
+ // if not on a user page
+ if (window.location.pathname.indexOf("/user") == -1) {
+ console.log("NOT A USER PAGE")
+ // and if logged in
+ if (await is_logged_in()) {
+ // move to the user index page
+ window.location.href = host + "/user/"
+ }
+ } else if (window.location.pathname == "/user/") {
+ await user()
+ }
+}
+
async function delete_form() {
const id = get_id();
const session = get_session();
diff --git a/src/user/index.html b/src/user/index.html
index 12fd680..87cedc0 100644
--- a/src/user/index.html
+++ b/src/user/index.html
@@ -5,7 +5,7 @@
<script src="/main.js" defer></script>
<title>USER</title>
</head>
- <body onload="user()">
+ <body>
<header>
<a href="/user/">
<center class="button navbutton">USER</center>