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>
|
<script>
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { userId } from '../UserState'
|
import { userId, isAdmin } from '../UserState'
|
||||||
|
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import page from 'page'
|
import page from 'page'
|
||||||
|
|
@ -22,7 +22,6 @@
|
||||||
let username;
|
let username;
|
||||||
let characters = [];
|
let characters = [];
|
||||||
let createDate;
|
let createDate;
|
||||||
let isAdmin;
|
|
||||||
let email;
|
let email;
|
||||||
let account;
|
let account;
|
||||||
|
|
||||||
|
|
@ -36,7 +35,6 @@
|
||||||
characters = resp.data.characters;
|
characters = resp.data.characters;
|
||||||
createDate = moment(resp.data.account_created).format('MMMM Do YYYY, h:mm:ss a')
|
createDate = moment(resp.data.account_created).format('MMMM Do YYYY, h:mm:ss a')
|
||||||
+ " (" + moment(resp.data.account_created).fromNow() + ")";
|
+ " (" + moment(resp.data.account_created).fromNow() + ")";
|
||||||
isAdmin = resp.data.admin;
|
|
||||||
email = resp.data.email;
|
email = resp.data.email;
|
||||||
|
|
||||||
ready = true
|
ready = true
|
||||||
|
|
@ -64,7 +62,9 @@
|
||||||
|
|
||||||
{#if account}
|
{#if account}
|
||||||
<h1>Account: <AccountLink account={account}/></h1>
|
<h1>Account: <AccountLink account={account}/></h1>
|
||||||
|
{#if $isAdmin}
|
||||||
<ActionButtons {account} />
|
<ActionButtons {account} />
|
||||||
|
{/if}
|
||||||
|
|
||||||
<form>
|
<form>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,9 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "cross-env NODE_ENV=production webpack --config webpack.config.cjs",
|
"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",
|
"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",
|
"dev-server": "nodemon -w api/ -w index.js",
|
||||||
"production": "npm run build && node index.js"
|
"production": "npm run build && npm run prod-server"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue