web: profile js...?

This commit is contained in:
rezazfn 2025-02-17 01:07:51 +08:00
parent 2dcc1d7381
commit 814f24c5d4
4 changed files with 69 additions and 15 deletions

8
Web/public/.idea/indexLayout.xml generated Normal file
View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="UserContentModel">
<attachedFolders />
<explicitIncludes />
<explicitExcludes />
</component>
</project>

6
Web/public/.idea/vcs.xml generated Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
</component>
</project>

View file

@ -4,7 +4,9 @@
<option name="autoReloadType" value="SELECTIVE" /> <option name="autoReloadType" value="SELECTIVE" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="894f9b22-d5a1-46d5-9153-c8d0f3e9f4e5" name="Changes" comment="" /> <list default="true" id="894f9b22-d5a1-46d5-9153-c8d0f3e9f4e5" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
@ -13,26 +15,26 @@
<component name="Git.Settings"> <component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/../.." /> <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/../.." />
</component> </component>
<component name="ProjectColorInfo"><![CDATA[{ <component name="ProjectColorInfo">{
"associatedIndex": 6 &quot;associatedIndex&quot;: 6
}]]></component> }</component>
<component name="ProjectId" id="2t878h0xAZRJsRYk3bMOLhmfKE8" /> <component name="ProjectId" id="2t878h0xAZRJsRYk3bMOLhmfKE8" />
<component name="ProjectViewState"> <component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" /> <option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" /> <option name="showLibraryContents" value="true" />
</component> </component>
<component name="PropertiesComponent"><![CDATA[{ <component name="PropertiesComponent">{
"keyToString": { &quot;keyToString&quot;: {
"RunOnceActivity.ShowReadmeOnStart": "true", &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
"git-widget-placeholder": "main", &quot;git-widget-placeholder&quot;: &quot;main&quot;,
"node.js.detected.package.eslint": "true", &quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
"node.js.detected.package.tslint": "true", &quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
"node.js.selected.package.eslint": "(autodetect)", &quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
"node.js.selected.package.tslint": "(autodetect)", &quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
"nodejs_package_manager_path": "npm", &quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
"vue.rearranger.settings.migration": "true" &quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
} }
}]]></component> }</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" /> <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager"> <component name="TaskManager">
<task active="true" id="Default" summary="Default task"> <task active="true" id="Default" summary="Default task">
@ -42,6 +44,7 @@
<option name="presentableId" value="Default" /> <option name="presentableId" value="Default" />
<updated>1739721691032</updated> <updated>1739721691032</updated>
<workItem from="1739721692659" duration="470000" /> <workItem from="1739721692659" duration="470000" />
<workItem from="1739724799443" duration="617000" />
</task> </task>
<servers /> <servers />
</component> </component>

View file

@ -0,0 +1,37 @@
// i literally dk what im doing :,)
const loadProfile = () => {
const urlParams = new URLSearchParams(window.location.search);
const uid = urlParams.get("uid");
const usernameText = document.getElementById("name");
const emailText = document.getElementById("email");
if (uid) {
console.log("Fetching user info", uid);
firebase.firestore().collection("users").doc(uid).get()
.then((doc) => {
if (doc.exists) {
// If the user data exists
const userData = doc.data();
usernameText.innerHTML = userData.displayName
emailText.innerHTML = userData.email
} else {
// If no user is found
console.error("User not found!");
usernameText.innerHTML = "User not found.";
emailText.innerHTML = "No user data available.";
}
})
} else {
// If no UID is found in the URL
console.error("No UID found");
usernameText.innerHTML = "Whoops!";
emailText.innerHTML = "No user to display.";
}
};
window.onload = loadProfile;