feat(market): flag a stale price instead of showing it as a fresh green number
The aggregate price is deliberately kept on a failed or old refresh (it's never cleared), so the hero number could be hours out of date while still drawn in the "live" green. It now turns amber with an "as of N min/h ago" caption and a hover tooltip carrying the friendly fetch error, when the last refresh failed or the aggregate is >=5 min old (only when the hero is the aggregate, not an exchange pair with its own feed). The hardcoded "Price fetch failed" default is now i18n. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include "history_scan_policy.h"
|
||||
#include "rpc/rpc_busy_gate.h"
|
||||
#include "../util/logger.h"
|
||||
#include "../util/i18n.h" // util::tr for the price-fetch-failed default
|
||||
|
||||
#include <algorithm>
|
||||
#include <cctype>
|
||||
@@ -1995,7 +1996,7 @@ void NetworkRefreshService::applyPriceRefreshFailure(WalletState& state,
|
||||
{
|
||||
state.market.price_loading = false;
|
||||
state.market.price_error = errorMessage.empty()
|
||||
? std::string("Price fetch failed")
|
||||
? std::string(util::tr("market_price_fetch_failed"))
|
||||
: errorMessage;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user