fix: log environment API user only once per session
- 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:
co-authored by
Claude Opus 4.5
parent
9b2000efc2
commit
eefb491e87
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user