Hide admin buttons on regular user

This commit is contained in:
Chord 2019-12-30 15:36:35 -05:00
parent 3c5482a4c7
commit e89f020ea8
2 changed files with 5 additions and 4 deletions

View file

@ -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">

View file

@ -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",