refactor: conditions simplification
This commit is contained in:
parent
7157a11895
commit
e65737c237
1 changed files with 43 additions and 47 deletions
|
|
@ -71,7 +71,6 @@ const PaperWalletDialog = ({ onConfirmed, onDissmised, open, props }) => {
|
|||
const classes = useStyles()
|
||||
|
||||
return (
|
||||
<>
|
||||
<Dialog
|
||||
open={open}
|
||||
aria-labelledby="form-dialog-title"
|
||||
|
|
@ -107,7 +106,6 @@ const PaperWalletDialog = ({ onConfirmed, onDissmised, open, props }) => {
|
|||
<Button onClick={() => onConfirmed(true)}>Confirm</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -154,7 +152,7 @@ const Blacklist = () => {
|
|||
|
||||
const rejectAddressReuse = complianceConfig?.rejectAddressReuse ?? false
|
||||
|
||||
const enablePaperWalletOnly = complianceConfig?.enablePaperWalletOnly ?? false
|
||||
const enablePaperWalletOnly = !!complianceConfig.enablePaperWalletOnly
|
||||
|
||||
const addressReuseSave = rawConfig => {
|
||||
const config = toNamespace('compliance')(rawConfig)
|
||||
|
|
@ -242,15 +240,13 @@ const Blacklist = () => {
|
|||
<P>Enable paper wallet (only)</P>
|
||||
<Switch
|
||||
checked={enablePaperWalletOnly}
|
||||
onChange={event => {
|
||||
if (enablePaperWalletOnly) {
|
||||
addressReuseSave({
|
||||
enablePaperWalletOnly: event.target.checked
|
||||
onChange={e =>
|
||||
enablePaperWalletOnly
|
||||
? addressReuseSave({
|
||||
enablePaperWalletOnly: e.target.checked
|
||||
})
|
||||
} else {
|
||||
setConfirmDialog(true)
|
||||
: setConfirmDialog(true)
|
||||
}
|
||||
}}
|
||||
value={enablePaperWalletOnly}
|
||||
/>
|
||||
<Label2>{enablePaperWalletOnly ? 'On' : 'Off'}</Label2>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue