Skip to content

Commit

Permalink
Remove redundant variable.
Browse files Browse the repository at this point in the history
Signed-off-by: XhmikosR <[email protected]>
  • Loading branch information
XhmikosR committed May 22, 2020
1 parent ab50e12 commit 65fb4be
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions scripts/pi-hole/js/groups-clients.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,13 +330,12 @@ function editClient() {
return;
}

var ipName = ip;
if (name.length > 0) {
ipName += " (" + name + ")";
ip += " (" + name + ")";
}

utils.disableAll();
utils.showAlert("info", "", "Editing client...", ipName);
utils.showAlert("info", "", "Editing client...", ip);
$.ajax({
url: "scripts/pi-hole/php/groups.php",
method: "post",
Expand All @@ -355,7 +354,7 @@ function editClient() {
"success",
"glyphicon glyphicon-pencil",
"Successfully " + done + " client",
ipName
ip
);
table.ajax.reload(null, false);
} else {
Expand Down Expand Up @@ -385,13 +384,12 @@ function deleteClient() {
var ip = tr.find("#ip_" + id).text();
var name = tr.find("#name_" + id).text();

var ipName = ip;
if (name.length > 0) {
ipName += " (" + name + ")";
ip += " (" + name + ")";
}

utils.disableAll();
utils.showAlert("info", "", "Deleting client...", ipName);
utils.showAlert("info", "", "Deleting client...", ip);
$.ajax({
url: "scripts/pi-hole/php/groups.php",
method: "post",
Expand All @@ -400,12 +398,7 @@ function deleteClient() {
success: function (response) {
utils.enableAll();
if (response.success) {
utils.showAlert(
"success",
"glyphicon glyphicon-trash",
"Successfully deleted client ",
ipName
);
utils.showAlert("success", "glyphicon glyphicon-trash", "Successfully deleted client ", ip);
table.row(tr).remove().draw(false).ajax.reload(null, false);
reloadClientSuggestions();
} else {
Expand Down

0 comments on commit 65fb4be

Please sign in to comment.