Added owner role, fixed reputation scaling

This commit is contained in:
Xodrium 2023-02-12 05:04:29 -05:00
parent e9723303d8
commit 010bccc89d
3 changed files with 9 additions and 2 deletions

View file

@ -39,7 +39,7 @@ let calcVote = function(up,down, type) {
rating = Math.round(rating * Math.log(totalPadded) * 10);
}
return rating * Math.log(totalPadded);
return rating;
}
let handleSubmit = async e => {

View file

@ -16,5 +16,8 @@ export async function load({ fetch, params, url }) {
const resUser = await fetch(`/api/userGet?user=${user}`);
const postJsonUser = (await resUser.json()) || {};
return { postJson, id, postJsonUser, user };
const resUserBio = await fetch(`/api/userBio?user=${user}`);
const postJsonUserBio = (await resUserBio.json()) || {};
return { postJson, id, postJsonUser, postJsonUserBio, user };
}

View file

@ -7,6 +7,7 @@
export let data;
let userData = data.postJsonUser.data;
let userBio = data.postJsonUserBio.data;
</script>
{#if userData}
@ -26,6 +27,9 @@
<p>
<b>Downvotes:</b> {userData.downvotes}
</p>
{#if userBio && userBio.roles == 69}
<p><b>This user is an Owner.</b></p>
{/if}
</span>
<span slot="footer">