Skip to content

Commit

Permalink
ui: show deleted flags count
Browse files Browse the repository at this point in the history
  • Loading branch information
silv3rr committed Sep 6, 2024
1 parent 0b33839 commit a0857bf
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/ui/controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,16 +261,9 @@ function set_cmd_result($cmd_out) {
'{$flags}' => implode(array_keys($flags_del))
);
$_result = $data->func(['flag_del', $replace_pairs]);
// TODO:
//if (!empty($matches['flag']) && empty($flags_add) && !empty($_result)) {
// set_cmd_result("DONE: deleted flags \"{$matches['flag']}\" from \"{$_SESSION['postdata']['select_user']}\"");
//}
//if ($flags_del = flags_list()) {
// set_cmd_result("DONE: user \"{$_SESSION['postdata']['select_user']}\" has no flags");
//}
// show actually deleted flags in notification
if (($flags_del !== flags_list()) && empty($flags_add) && !empty($_result)) {
set_cmd_result("DONE: deleted flags \"" . implode(array_keys($flags_del)) . "\" from \"{$_SESSION['postdata']['select_user']}\"");
$_count = count(array_diff($flags_userfile, $flags_del)) - 1;
if ($_count > 0 && empty($flags_add) && !empty($_result)) {
set_cmd_result("DONE: deleted " . $_count . " flag(s) from \"{$_SESSION['postdata']['select_user']}\"");
}
}
if (!empty($flags_add)) {
Expand Down

0 comments on commit a0857bf

Please sign in to comment.