fix: log environment API user only once per session
Build and Push / release (push) Successful in 3s
Build and Push / build (push) Successful in 3m11s

- Store user in static variable for reuse
- Only debugPrint on first successful load

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Jeroen Schweitzer
2026-01-07 15:40:06 +01:00
co-authored by Claude Opus 4.5
parent 9b2000efc2
commit eefb491e87
3 changed files with 20 additions and 3 deletions
@@ -26,6 +26,13 @@ class _DashboardContentState extends ConsumerState<DashboardContent> {
Timer? _systemStatsTimer;
Timer? _environmentTimer;
/// Tracks if we've logged the environment API user (log once per session)
static bool _hasLoggedEnvUser = false;
static String? _envApiUser;
/// Get the environment API user (available after first load)
static String? get envApiUser => _envApiUser;
@override
void initState() {
super.initState();
@@ -133,8 +140,12 @@ class _DashboardContentState extends ConsumerState<DashboardContent> {
const SizedBox(height: 8),
environmentAsync.when(
data: (envData) {
// Debug: log user on first load
debugPrint('Environment API user: ${envData.user}');
// Store and log user once per session
if (!_hasLoggedEnvUser && envData.user != null) {
_envApiUser = envData.user;
_hasLoggedEnvUser = true;
debugPrint('Environment API user: ${envData.user}');
}
return _EnvironmentSection(
envData: envData,
onRefresh: () => ref.invalidate(environmentProvider),