feat(peers): success toasts for ban/unban/clear + confirm the bulk Clear-All
Peer ban actions only toasted on failure; success was silent. Added success toasts for ban/unban/clear-all, and the bulk "Clear All Bans" now takes a confirming second click (per-row unban stays one-click). The setban/clearbanned RPC calls are unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+3
-2
@@ -3772,7 +3772,7 @@ void App::banPeer(const std::string& ip, int duration_seconds)
|
||||
}
|
||||
return [this, err]() {
|
||||
if (!err.empty()) ui::Notifications::instance().error(std::string(TR("toast_ban_failed")) + util::friendlyRpcError(err));
|
||||
else refreshPeerInfo();
|
||||
else { ui::Notifications::instance().success(TR("toast_peer_banned")); refreshPeerInfo(); }
|
||||
};
|
||||
});
|
||||
}
|
||||
@@ -3790,7 +3790,7 @@ void App::unbanPeer(const std::string& ip)
|
||||
}
|
||||
return [this, err]() {
|
||||
if (!err.empty()) ui::Notifications::instance().error(std::string(TR("toast_unban_failed")) + util::friendlyRpcError(err));
|
||||
else refreshPeerInfo();
|
||||
else { ui::Notifications::instance().success(TR("toast_peer_unbanned")); refreshPeerInfo(); }
|
||||
};
|
||||
});
|
||||
}
|
||||
@@ -3809,6 +3809,7 @@ void App::clearBans()
|
||||
return [this, err]() {
|
||||
if (!err.empty()) { ui::Notifications::instance().error(std::string(TR("toast_clear_bans_failed")) + util::friendlyRpcError(err)); return; }
|
||||
state_.banned_peers.clear();
|
||||
ui::Notifications::instance().success(TR("toast_bans_cleared"));
|
||||
refreshPeerInfo();
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user