* client: fix page scrolling on adding/deleting leases

This commit is contained in:
Ildar Kamalov
2019-05-28 18:02:02 +03:00
committed by Simon Zolin
parent 6f2503a09f
commit 2976726f99
4 changed files with 24 additions and 11 deletions

View File

@@ -18,9 +18,10 @@ class StaticLeases extends Component {
this.props.addStaticLease(data);
}
handleDelete = (ip, mac, hostname) => {
handleDelete = (ip, mac, hostname = '') => {
const name = hostname || ip;
// eslint-disable-next-line no-alert
if (window.confirm(this.props.t('delete_confirm', { key: hostname }))) {
if (window.confirm(this.props.t('delete_confirm', { key: name }))) {
this.props.removeStaticLease({ ip, mac, hostname });
}
}