fix recommit after commit already

This commit is contained in:
monoid 2021-10-11 22:51:01 +09:00
parent 9b829c384c
commit 65818f1db4

View File

@ -30,11 +30,18 @@ function TypeDifference(prop:{
}){
const classes = useStyles();
const x = prop.content;
const [button_disable,set_disable] = useState(false);
return (<Paper className={classes.paper}>
<Typography variant='h3' className={classes.contentTitle}>{x.type}</Typography>
{x.value.map(y=>(
<Box className={classes.commitable} key={y.path}>
<Button onClick={()=>prop.onCommit(y)}>Commit</Button>
<Box className={classes.commitable} key={y.path}>
<Button onClick={()=>{
set_disable(true);
prop.onCommit(y);
set_disable(false);
}}
disabled={button_disable}>Commit</Button>
<Typography variant='h5'>{y.path}</Typography>
</Box>
))}