chore(frontend): 移除资产页面调试日志

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-01-17 23:16:15 -08:00
parent 4eb466230e
commit b826511f3c
1 changed files with 0 additions and 13 deletions

View File

@ -49,7 +49,6 @@ class _AssetPageState extends ConsumerState<AssetPage> {
void _startTimerWithGrowth(AssetDisplay asset, String perSecondEarning) { void _startTimerWithGrowth(AssetDisplay asset, String perSecondEarning) {
// //
if (_timerStarted && _refreshTimer != null) { if (_timerStarted && _refreshTimer != null) {
debugPrint('[AssetPage] Timer already started, skipping');
return; return;
} }
@ -61,14 +60,11 @@ class _AssetPageState extends ConsumerState<AssetPage> {
_growthPerSecond = double.tryParse(perSecondEarning) ?? 0; _growthPerSecond = double.tryParse(perSecondEarning) ?? 0;
_timerStarted = true; _timerStarted = true;
debugPrint('[AssetPage] Starting timer: perSecondEarning=$perSecondEarning, growthPerSecond=$_growthPerSecond, initialDisplayValue=$_initialDisplayValue');
_refreshTimer = Timer.periodic(const Duration(seconds: 1), (timer) { _refreshTimer = Timer.periodic(const Duration(seconds: 1), (timer) {
if (mounted) { if (mounted) {
setState(() { setState(() {
_elapsedSeconds++; _elapsedSeconds++;
}); });
debugPrint('[AssetPage] Timer tick: $_elapsedSeconds, currentDisplayValue=$_currentDisplayValue');
} }
}); });
} }
@ -111,15 +107,10 @@ class _AssetPageState extends ConsumerState<AssetPage> {
final perSecondEarning = shareAccount?.perSecondEarning ?? '0'; final perSecondEarning = shareAccount?.perSecondEarning ?? '0';
final hasValidGrowth = (double.tryParse(perSecondEarning) ?? 0) > 0; final hasValidGrowth = (double.tryParse(perSecondEarning) ?? 0) > 0;
//
debugPrint('[AssetPage] build: accountSequence=$accountSequence, asset=${asset != null}, shareAccount=${shareAccount != null}');
debugPrint('[AssetPage] build: perSecondEarning=$perSecondEarning, hasValidGrowth=$hasValidGrowth, _timerStarted=$_timerStarted, _lastAccountSequence=$_lastAccountSequence');
// //
if (asset != null && hasValidGrowth) { if (asset != null && hasValidGrowth) {
// //
if (_lastAccountSequence != accountSequence) { if (_lastAccountSequence != accountSequence) {
debugPrint('[AssetPage] Account changed or first load, resetting timer');
_lastAccountSequence = accountSequence; _lastAccountSequence = accountSequence;
_lastAsset = asset; _lastAsset = asset;
_resetTimer(); _resetTimer();
@ -128,7 +119,6 @@ class _AssetPageState extends ConsumerState<AssetPage> {
}); });
} else if (!_timerStarted) { } else if (!_timerStarted) {
// //
debugPrint('[AssetPage] Timer not started, starting now');
_lastAsset = asset; _lastAsset = asset;
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
if (mounted) _startTimerWithGrowth(asset, perSecondEarning); if (mounted) _startTimerWithGrowth(asset, perSecondEarning);
@ -137,10 +127,7 @@ class _AssetPageState extends ConsumerState<AssetPage> {
_lastAsset = asset; _lastAsset = asset;
} }
} else if (asset != null) { } else if (asset != null) {
debugPrint('[AssetPage] Asset loaded but no valid growth: perSecondEarning=$perSecondEarning');
_lastAsset = asset; _lastAsset = asset;
} else {
debugPrint('[AssetPage] Asset is null, waiting for data');
} }
return Scaffold( return Scaffold(