[chore] remove unneeded checks

args will always be defined, and an array, additionally Array.some()
will always return false if the array is empty. So these conditions
are uneeded.
pull/13747/head
Sam Lanning 6 years ago committed by 偏右
parent 2f0580d08b
commit bfc75f5872

@ -136,7 +136,7 @@ export default function confirm(config: ModalFuncProps) {
if (unmountResult && div.parentNode) {
div.parentNode.removeChild(div);
}
const triggerCancel = args && args.length && args.some(param => param && param.triggerCancel);
const triggerCancel = args.some(param => param && param.triggerCancel);
if (config.onCancel && triggerCancel) {
config.onCancel(...args);
}

Loading…
Cancel
Save