mirror of
https://github.com/psforever/PSFPortal.git
synced 2026-01-19 18:14:45 +00:00
Hide admin buttons on regular user
This commit is contained in:
parent
3c5482a4c7
commit
e89f020ea8
|
|
@ -1,6 +1,6 @@
|
|||
<script>
|
||||
import { onMount } from 'svelte';
|
||||
import { userId } from '../UserState'
|
||||
import { userId, isAdmin } from '../UserState'
|
||||
|
||||
import axios from 'axios'
|
||||
import page from 'page'
|
||||
|
|
@ -22,7 +22,6 @@
|
|||
let username;
|
||||
let characters = [];
|
||||
let createDate;
|
||||
let isAdmin;
|
||||
let email;
|
||||
let account;
|
||||
|
||||
|
|
@ -36,7 +35,6 @@
|
|||
characters = resp.data.characters;
|
||||
createDate = moment(resp.data.account_created).format('MMMM Do YYYY, h:mm:ss a')
|
||||
+ " (" + moment(resp.data.account_created).fromNow() + ")";
|
||||
isAdmin = resp.data.admin;
|
||||
email = resp.data.email;
|
||||
|
||||
ready = true
|
||||
|
|
@ -64,7 +62,9 @@
|
|||
|
||||
{#if account}
|
||||
<h1>Account: <AccountLink account={account}/></h1>
|
||||
{#if $isAdmin}
|
||||
<ActionButtons {account} />
|
||||
{/if}
|
||||
|
||||
<form>
|
||||
<div class="form-group row">
|
||||
|
|
|
|||
|
|
@ -7,8 +7,9 @@
|
|||
"scripts": {
|
||||
"build": "cross-env NODE_ENV=production webpack --config webpack.config.cjs",
|
||||
"dev": "webpack-dev-server --history-api-fallback --config webpack.config.cjs --content-base public",
|
||||
"prod-server": "cross-env NODE_ENV=production node index.js",
|
||||
"dev-server": "nodemon -w api/ -w index.js",
|
||||
"production": "npm run build && node index.js"
|
||||
"production": "npm run build && npm run prod-server"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
|
|||
Loading…
Reference in a new issue