Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: My Account access block #6

Merged
merged 1 commit into from
Mar 19, 2024

Conversation

nemoforte
Copy link
Collaborator

The purpose of this branch is to block access to MyAccountPage if the connected network does not contain information about default token or bech32 address prefix.

List of changes:

  • created global_nav_controller.dart to enable navigation without passing an instance of BuildContext
  • added "leaveProtectedPage()" method from global_nav_controller.dart to "signOut()" method auth_cubit.dart to link those 2 actions
  • added methods in network_module_bloc.dart with reference to auth_cubit.dart to automatically log out and leave MyAccountPage if user changes to unhealthy network that does not contain TokenDefaultDenomModel
  • modified sign_in_drawer_page.dart to block connecting the wallet if network does not contain TokenDefaultDenomModel and created sign_in_drawer_warning_section.dart to display "Change network" button and refresh network timer in this case
  • added NetworkModuleState.refreshing() to provide information about network refreshing to SignInDrawerPage
  • added "lastRefreshDateTime" to all Network Models (except NetworkEmptyModel) to save info about time of last refresh of each network. This enabled creating a timer in SignInDrawerPage and optimizing network refreshing in network_module_bloc.dart and network_custom_section.cubit.dart.
  • renamed "timed_refresh_button_cubit.dart" -> "time_counter_cubit.dart" since it was used in sign_in_drawer_warning_section.dart, so it became a generic cubit instead of specific widget centered
  • removed redundant method from network_module_service.dart and changed nullable TokenDefaultDenomModel to bool variable "valuesFromNetworkExistBool" inside this model
  • unrelated with the branch's specific domain: added conditions in network_module_bloc.dart and network_custom_section_cubit.dart to prevent still refreshing networks from being refreshed again
  • unrelated with the branch's specific domain: added TODO about removing IdentityRegistrarCubit initialization in main.dart

The purpose of this branch is to block access to MyAccountPage if the connected network does not contain information about default token or bech32 address prefix.

List of changes:
- created global_nav_controller.dart to enable navigation without passing an instance of BuildContext
- added "leaveProtectedPage()" method from global_nav_controller.dart to "signOut()" method auth_cubit.dart to link those 2 actions
- added methods in network_module_bloc.dart with reference to auth_cubit.dart to automatically log out and leave MyAccountPage if user changes to unhealthy network that does not contain TokenDefaultDenomModel
- modified sign_in_drawer_page.dart to block connecting the wallet if network does not contain TokenDefaultDenomModel
and created sign_in_drawer_warning_section.dart to display "Change network" button and refresh network timer in this case
- added NetworkModuleState.refreshing() to provide information about network refreshing to SignInDrawerPage
- added "lastRefreshDateTime" to all Network Models (except NetworkEmptyModel) to save info about time of last refresh of each network. This enabled creating a timer in SignInDrawerPage and optimizing network refreshing in network_module_bloc.dart and network_custom_section.cubit.dart.
- renamed "timed_refresh_button_cubit.dart" -> "time_counter_cubit.dart" since it was used in sign_in_drawer_warning_section.dart, so it became a generic cubit instead of specific widget centered
- removed redundant method from network_module_service.dart and changed nullable TokenDefaultDenomModel to bool variable "valuesFromNetworkExistBool" inside this model
- unrelated with the branch's specific domain: added conditions in network_module_bloc.dart and network_custom_section_cubit.dart to prevent still refreshing networks from being refreshed again
- unrelated with the branch's specific domain: added TODO about removing IdentityRegistrarCubit initialization in main.dart
@nemoforte nemoforte requested review from kronikarz and dpajak99 March 19, 2024 11:56
@kronikarz kronikarz merged commit d89552a into dev Mar 19, 2024
3 checks passed
@kronikarz kronikarz deleted the mj-feature/my-account-access-block branch March 19, 2024 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants