From 04f08c1b1c56593f3ec73f4a979377413c8fe70f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leon=20B=C3=B6sche?= Date: Thu, 29 Jan 2026 20:19:20 +0100 Subject: [PATCH] Refactor profile update logic and remove debug prints --- .../lib/widgets/account_settings_dialog.dart | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/b0esche_cloud/lib/widgets/account_settings_dialog.dart b/b0esche_cloud/lib/widgets/account_settings_dialog.dart index 63b9d51..68cae38 100644 --- a/b0esche_cloud/lib/widgets/account_settings_dialog.dart +++ b/b0esche_cloud/lib/widgets/account_settings_dialog.dart @@ -59,7 +59,8 @@ class _AccountSettingsDialogState extends State { // Listen for changes in display name _displayNameController.addListener(() { - final newHasChanges = _displayNameController.text != (_currentUser?.displayName ?? ''); + final newHasChanges = + _displayNameController.text != (_currentUser?.displayName ?? ''); if (_hasChanges != newHasChanges) { setState(() => _hasChanges = newHasChanges); } @@ -148,9 +149,6 @@ class _AccountSettingsDialogState extends State { } Future _updateProfile() async { - print( - 'DEBUG: _updateProfile called with displayName: ${_displayNameController.text}', - ); if (_currentUser == null) { return; } @@ -183,7 +181,6 @@ class _AccountSettingsDialogState extends State { Navigator.of(context).pop(); } } catch (e) { - print('DEBUG: _updateProfile error: $e'); if (mounted) { // Show error message ScaffoldMessenger.of( @@ -651,7 +648,9 @@ class _AccountSettingsDialogState extends State { child: SizedBox( width: 144, child: ModernGlassButton( - onPressed: _isLoading || !_hasChanges ? null : () => _updateProfile(), + onPressed: () { + if (!_isLoading && _hasChanges) _updateProfile(); + }, isLoading: _isLoading, child: _isLoading ? const SizedBox(