Skip to content

Commit

Permalink
feat: empty right selected before close Dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
elfiyang16 authored and dadiorchen committed Jun 30, 2020
1 parent 160ffd9 commit c3abe94
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions client/src/components/Users.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import FileCopyIcon from '@material-ui/icons/FileCopy'
import axios from 'axios'
import { AppContext } from './MainFrame'
import pwdGenerator from 'generate-password'
import dateformat from 'dateformat';
import dateformat from 'dateformat'

const style = (theme) => ({
box: {
Expand Down Expand Up @@ -265,6 +265,7 @@ function Users(props) {
)
if (res.status === 201) {
setUserEditing(undefined)
setRight([])
load()
} else {
console.error('load fail:', res)
Expand All @@ -283,6 +284,7 @@ function Users(props) {
)
if (res.status === 200) {
setUserEditing(undefined)
setRight([])
load()
} else {
console.error('load fail:', res)
Expand Down Expand Up @@ -348,6 +350,7 @@ function Users(props) {

function handleUserDetailClose() {
setUserEditing(undefined)
setRight([])
}

const handleCopy = () => {
Expand Down Expand Up @@ -538,16 +541,17 @@ function Users(props) {
onChange={handleEmailChange}
/>
{userEditing && userEditing.createdAt && (
<Grid container spacing={2}>
<Grid item>
<Typography variant="outline">Created</Typography>
</Grid>
<Grid item>
<Typography variant="outline">
{userEditing && dateformat(userEditing.createdAt, 'm/d/yyyy h:MMtt')}
</Typography>
<Grid container spacing={2}>
<Grid item>
<Typography variant="outline">Created</Typography>
</Grid>
<Grid item>
<Typography variant="outline">
{userEditing && dateformat(userEditing.createdAt, 'm/d/yyyy h:MMtt')}
</Typography>
</Grid>
</Grid>
</Grid>)}
)}
<Grid container spacing={2} justify="center" alignItems="center" className={classes.root}>
<Grid item role="list">
<Typography variant="outline">Roles</Typography>
Expand Down

0 comments on commit c3abe94

Please sign in to comment.