diff --git a/modules/legacy/modules/account/lib/src/features/change_password/presentation/change_password_screen.dart b/modules/legacy/modules/account/lib/src/features/change_password/presentation/change_password_screen.dart index c0fef8ca..ea4fd005 100644 --- a/modules/legacy/modules/account/lib/src/features/change_password/presentation/change_password_screen.dart +++ b/modules/legacy/modules/account/lib/src/features/change_password/presentation/change_password_screen.dart @@ -68,7 +68,9 @@ class _ChangePasswordScreenState extends ConsumerState { } }); - final submitState = ref.watch(changePasswordControllerProvider); + final isLoading = ref.watch( + changePasswordControllerProvider.select((s) => s.isLoading), + ); return LegacyPageLayout( title: context.translate(I18n.changePassword), @@ -108,7 +110,7 @@ class _ChangePasswordScreenState extends ConsumerState { footer: Padding( padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 10), child: PrimaryButton( - onPressed: submitState.isLoading ? null : _onSubmit, + onPressed: isLoading ? null : _onSubmit, text: context.translate(I18n.save), color: context.sfColors.legacyPrimary, ), diff --git a/modules/legacy/modules/account/lib/src/features/linked_devices/presentation/edit_linked_device_screen.dart b/modules/legacy/modules/account/lib/src/features/linked_devices/presentation/edit_linked_device_screen.dart index 565d19d2..18ad7a39 100644 --- a/modules/legacy/modules/account/lib/src/features/linked_devices/presentation/edit_linked_device_screen.dart +++ b/modules/legacy/modules/account/lib/src/features/linked_devices/presentation/edit_linked_device_screen.dart @@ -62,7 +62,9 @@ class _EditLinkedDeviceScreenState } }); - final submitState = ref.watch(linkedDevicesControllerProvider); + final isLoading = ref.watch( + linkedDevicesControllerProvider.select((s) => s.isLoading), + ); return LegacyPageLayout( title: context.translate(I18n.editDeviceTitle), @@ -131,7 +133,7 @@ class _EditLinkedDeviceScreenState footer: Padding( padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 10), child: PrimaryButton( - onPressed: submitState.isLoading ? null : _onSubmit, + onPressed: isLoading ? null : _onSubmit, text: context.translate(I18n.save), color: context.sfColors.legacyPrimary, ), diff --git a/modules/legacy/modules/account/lib/src/features/personal_data/presentation/personal_data_screen.dart b/modules/legacy/modules/account/lib/src/features/personal_data/presentation/personal_data_screen.dart index cad13029..d9fbc3a2 100644 --- a/modules/legacy/modules/account/lib/src/features/personal_data/presentation/personal_data_screen.dart +++ b/modules/legacy/modules/account/lib/src/features/personal_data/presentation/personal_data_screen.dart @@ -119,7 +119,9 @@ class _PersonalDataFormState extends ConsumerState<_PersonalDataForm> { } }); - final submitState = ref.watch(personalDataControllerProvider); + final isLoading = ref.watch( + personalDataControllerProvider.select((s) => s.isLoading), + ); return LegacyPageLayout( title: context.translate(I18n.personalData), @@ -204,7 +206,7 @@ class _PersonalDataFormState extends ConsumerState<_PersonalDataForm> { vertical: 10, ), child: PrimaryButton( - onPressed: submitState.isLoading ? null : _onSubmit, + onPressed: isLoading ? null : _onSubmit, text: context.translate(I18n.submit), color: context.sfColors.legacyPrimary, ),