diff --git a/mih_ui/lib/mih_config/mih_go_router.dart b/mih_ui/lib/mih_config/mih_go_router.dart index d1756d98..ac1b3a83 100644 --- a/mih_ui/lib/mih_config/mih_go_router.dart +++ b/mih_ui/lib/mih_config/mih_go_router.dart @@ -30,8 +30,8 @@ import 'package:mzansi_innovation_hub/mih_packages/mzansi_wallet/mih_wallet.dart import 'package:mzansi_innovation_hub/mih_packages/patient_manager/pat_manager/pat_manager.dart'; import 'package:mzansi_innovation_hub/mih_packages/patient_manager/pat_profile/patient_profile.dart'; import 'package:mzansi_innovation_hub/mih_packages/patient_manager/pat_profile/patient_set_up.dart'; +import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart'; import 'package:provider/provider.dart'; -import 'package:supertokens_flutter/supertokens.dart'; class MihGoRouterPaths { // External @@ -73,7 +73,11 @@ class MihGoRouter { final GoRouter mihRouter = GoRouter( initialLocation: MihGoRouterPaths.mihHome, redirect: (BuildContext context, GoRouterState state) async { - final bool isUserSignedIn = await SuperTokens.doesSessionExist(); + // final bool isUserSignedIn = await SuperTokens.doesSessionExist(); + MzansiProfileProvider profileProvider = + context.read(); + final bool isUserSignedIn = profileProvider.hasLocalProfile(); + final unauthenticatedPaths = [ MihGoRouterPaths.mihAuthentication, "${MihGoRouterPaths.mihAuthentication}/${MihGoRouterPaths.forgotPassword}", diff --git a/mih_ui/lib/mih_hive/mzansi_profile_hive_data.dart b/mih_ui/lib/mih_hive/mzansi_profile_hive_data.dart index 8ea47eec..8e1cdfd3 100644 --- a/mih_ui/lib/mih_hive/mzansi_profile_hive_data.dart +++ b/mih_ui/lib/mih_hive/mzansi_profile_hive_data.dart @@ -206,7 +206,7 @@ class MzansiProfileHiveData { ); if (responseCode != null && responseCode == 201) { await _modificationsQueue.delete(taskKey); - KenLogger.success("Add User Consent to MIH Server"); + KenLogger.success("Add User Consent to MIH Cloud"); } } } @@ -217,4 +217,8 @@ class MzansiProfileHiveData { bool isModificationsNotEmpty() { return _modificationsQueue.values.toList().isNotEmpty; } + + bool hasCachedProfile() { + return _userBox.containsKey(kUserKey); + } } diff --git a/mih_ui/lib/mih_hive/mzansi_wallet_hive_data.dart b/mih_ui/lib/mih_hive/mzansi_wallet_hive_data.dart index 8a2f91f4..8fff492b 100644 --- a/mih_ui/lib/mih_hive/mzansi_wallet_hive_data.dart +++ b/mih_ui/lib/mih_hive/mzansi_wallet_hive_data.dart @@ -245,7 +245,7 @@ class MzansiWalletHiveData { ); if (responseCode != null && responseCode == 201) { await _modificationsQueue.delete(taskKey); - KenLogger.success("Add New Local Card to MIH Server"); + KenLogger.success("Add New Local Card to MIH Cloud"); } else { KenLogger.warning("MIH App Operating in Offline Mode. Sync Paused"); return false; @@ -258,7 +258,7 @@ class MzansiWalletHiveData { ); if (responseCode != null && responseCode == 200) { await _modificationsQueue.delete(taskKey); - KenLogger.success("Delete Local Card from MIH Server"); + KenLogger.success("Delete Local Card from MIH Cloud"); } else { KenLogger.warning("MIH App Operating in Offline Mode. Sync Paused"); return false; @@ -275,7 +275,7 @@ class MzansiWalletHiveData { ); if (responseCode != null && responseCode == 200) { await _modificationsQueue.delete(taskKey); - KenLogger.success("Update Local Card from MIH Server"); + KenLogger.success("Update Local Card from MIH Cloud"); } else { KenLogger.warning("MIH App Operating in Offline Mode. Sync Paused"); return false; diff --git a/mih_ui/lib/mih_package_components/Example/package_test.dart b/mih_ui/lib/mih_package_components/Example/package_test.dart index 8d886a1c..00ccabc4 100644 --- a/mih_ui/lib/mih_package_components/Example/package_test.dart +++ b/mih_ui/lib/mih_package_components/Example/package_test.dart @@ -1,5 +1,6 @@ import 'package:go_router/go_router.dart'; import 'package:mih_package_toolkit/mih_package_toolkit.dart'; +import 'package:mzansi_innovation_hub/mih_package_components/Example/package_tools/package_tool_four.dart'; import 'package:mzansi_innovation_hub/mih_package_components/Example/package_tools/package_tool_three.dart'; import 'package:mzansi_innovation_hub/mih_package_components/Example/package_tools/package_tool_zero.dart'; import 'package:mzansi_innovation_hub/mih_package_components/Example/package_tools/package_tool_one.dart'; @@ -61,26 +62,31 @@ class _PackageTestState extends State { MihPackageTools getTools() { Map temp = Map(); - temp[const Icon(Icons.link)] = () { + temp[const Icon(Icons.lock)] = () { setState(() { _selectedIndex = 0; }); }; - temp[const Icon(Icons.warning)] = () { + temp[const Icon(Icons.link)] = () { setState(() { _selectedIndex = 1; }); }; - temp[const Icon(Icons.inbox)] = () { + temp[const Icon(Icons.warning)] = () { setState(() { _selectedIndex = 2; }); }; - temp[const Icon(Icons.outbond)] = () { + temp[const Icon(Icons.inbox)] = () { setState(() { _selectedIndex = 3; }); }; + temp[const Icon(Icons.outbond)] = () { + setState(() { + _selectedIndex = 4; + }); + }; return MihPackageTools( tools: temp, selectedIndex: _selectedIndex, @@ -95,6 +101,8 @@ class _PackageTestState extends State { MzansiProfileProvider profileProvider = context.read(); List toolBodies = [ + const PackageToolFour(), + const PackageToolThree(), const PackageToolThree(), const PackageToolZero(), PackageToolOne( @@ -108,9 +116,12 @@ class _PackageTestState extends State { List getToolTitle() { List toolTitles = [ - "Tool Zero", "Tool One", "Tool Two", + "Tool Three", + "Tool Four", + "Tool Five", + "Tool Six", ]; return toolTitles; } diff --git a/mih_ui/lib/mih_package_components/Example/package_tools/package_tool_four.dart b/mih_ui/lib/mih_package_components/Example/package_tools/package_tool_four.dart new file mode 100644 index 00000000..8e38d1f8 --- /dev/null +++ b/mih_ui/lib/mih_package_components/Example/package_tools/package_tool_four.dart @@ -0,0 +1,40 @@ +import 'package:flutter/material.dart'; +import 'package:ken_logger/ken_logger.dart'; +import 'package:mih_package_toolkit/mih_package_toolkit.dart'; +import 'package:mzansi_innovation_hub/mih_packages/mih_home/components/mih_soft_login_popup.dart'; + +class PackageToolFour extends StatefulWidget { + const PackageToolFour({super.key}); + + @override + State createState() => _PackageToolFourState(); +} + +class _PackageToolFourState extends State { + @override + Widget build(BuildContext context) { + return Column( + children: [ + MihButton( + onPressed: () async { + final bool didReauthenticate = await showDialog( + context: context, + barrierDismissible: true, + builder: (BuildContext context) => const MihSoftLoginPopup(), + ) ?? + false; + KenLogger.success("reauthenticate Successful: $didReauthenticate"); + }, + buttonColor: MihColors.secondary(), + width: 300, + child: Text( + "Soft Login", + style: TextStyle( + color: MihColors.primary(), + ), + ), + ), + ], + ); + } +} diff --git a/mih_ui/lib/mih_packages/mih_authentication/package_tools/mih_sign_in.dart b/mih_ui/lib/mih_packages/mih_authentication/package_tools/mih_sign_in.dart index 8328417f..1c7ecdeb 100644 --- a/mih_ui/lib/mih_packages/mih_authentication/package_tools/mih_sign_in.dart +++ b/mih_ui/lib/mih_packages/mih_authentication/package_tools/mih_sign_in.dart @@ -33,7 +33,9 @@ class _MihSignInState extends State { //sign user in Future signUserIn() async { - context.read().reset(); + MzansiProfileProvider profileProvider = + context.read(); + profileProvider.reset(); try { successfulSignIn = await MihAuthenticationServices().signUserIn( emailController.text, @@ -43,6 +45,8 @@ class _MihSignInState extends State { if (!successfulSignIn) { MihAlertServices().loginErrorAlert(context); passwordController.clear(); + } else { + await profileProvider.syncWithMihServerData(); } } on Exception { Navigator.of(context).pop(); diff --git a/mih_ui/lib/mih_packages/mih_home/components/mih_app_drawer.dart b/mih_ui/lib/mih_packages/mih_home/components/mih_app_drawer.dart index 5a659af8..25803cd4 100644 --- a/mih_ui/lib/mih_packages/mih_home/components/mih_app_drawer.dart +++ b/mih_ui/lib/mih_packages/mih_home/components/mih_app_drawer.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; import 'package:mih_package_toolkit/mih_package_toolkit.dart'; import 'package:mzansi_innovation_hub/mih_package_components/mih_circle_avatar.dart'; +import 'package:mzansi_innovation_hub/mih_packages/mih_home/components/mih_sign_out_warning.dart'; import 'package:mzansi_innovation_hub/mih_providers/about_mih_provider.dart'; import 'package:mzansi_innovation_hub/mih_providers/mih_access_controlls_provider.dart'; import 'package:mzansi_innovation_hub/mih_providers/mih_authentication_provider.dart'; @@ -45,11 +46,37 @@ class _MIHAppDrawerState extends State { await context.read().clearProfileCacheAndProvider(); } - Future signOut() async { - await SuperTokens.signOut(completionHandler: (error) { - // handle error if any - }); - return true; + Future signOut() async { + if (!context.mounted) return; + final bool continueSignOut = await showDialog( + context: context, + barrierDismissible: false, + builder: (BuildContext context) => const MihSignOutWarning(), + ) ?? + false; + if (!continueSignOut) { + if (context.mounted) { + context.pop(); + ScaffoldMessenger.of(context).showSnackBar( + MihSnackBar( + child: const Text("Sign Out Cancelled"), + ), + ); + } + return; // Stop execution here; local data remains safe + } else { + await SuperTokens.signOut(completionHandler: (error) { + print(error); + }); + if (await SuperTokens.doesSessionExist() == false) { + await clearCacheAndProviders(); + if (context.mounted) { + context.goNamed( + 'mihHome', + ); + } + } + } } Widget displayProPic(MzansiProfileProvider mzansiProfileProvider) { @@ -260,19 +287,7 @@ class _MIHAppDrawerState extends State { ], ), onTap: () async { - await SuperTokens.signOut( - completionHandler: (error) { - print(error); - }); - if (await SuperTokens.doesSessionExist() == - false) { - await clearCacheAndProviders(); - if (context.mounted) { - context.goNamed( - 'mihHome', - ); - } - } + signOut(); }, ), ], diff --git a/mih_ui/lib/mih_packages/mih_home/components/mih_sign_out_warning.dart b/mih_ui/lib/mih_packages/mih_home/components/mih_sign_out_warning.dart new file mode 100644 index 00000000..34bdd323 --- /dev/null +++ b/mih_ui/lib/mih_packages/mih_home/components/mih_sign_out_warning.dart @@ -0,0 +1,92 @@ +import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; +import 'package:mih_package_toolkit/mih_package_toolkit.dart'; + +class MihSignOutWarning extends StatefulWidget { + const MihSignOutWarning({super.key}); + + @override + State createState() => _MihSignOutWarningState(); +} + +class _MihSignOutWarningState extends State { + @override + Widget build(BuildContext context) { + return MihPackageWindow( + fullscreen: false, + backgroundColor: MihColors.secondary(), + windowTitle: null, + onWindowTapClose: null, + windowBody: Column( + children: [ + Icon( + Icons.warning_amber_rounded, + size: 150, + color: MihColors.primary(), + ), + Center( + child: Text( + "Are You Sure?", + textAlign: TextAlign.center, + style: TextStyle( + color: MihColors.primary(), + fontSize: 25, + fontWeight: FontWeight.bold, + ), + ), + ), + const SizedBox(height: 15), + Text( + "Signing out clears your local app data. If any of your recent offline changes or updates haven't finished syncing to the MIH cloud, they will be permanently lost.\n\nPlease ensure you are connected to the internet and fully synced before signing out.", + style: TextStyle( + color: MihColors.primary(), + fontSize: 18, + fontWeight: FontWeight.bold, + ), + ), + const SizedBox(height: 15), + Center( + child: Wrap( + spacing: 10.0, + runSpacing: 10.0, + alignment: WrapAlignment.center, + children: [ + MihButton( + onPressed: () { + context.pop(false); + }, + buttonColor: MihColors.green(), + width: 300, + child: Text( + "Dismiss", + style: TextStyle( + color: MihColors.primary(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + ), + const SizedBox(height: 10), + MihButton( + onPressed: () { + context.pop(true); + }, + buttonColor: MihColors.red(), + width: 300, + child: Text( + "Sign Out", + style: TextStyle( + color: MihColors.primary(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + ), + ], + ), + ), + ], + ), + ); + } +} diff --git a/mih_ui/lib/mih_packages/mih_home/components/mih_soft_login_popup.dart b/mih_ui/lib/mih_packages/mih_home/components/mih_soft_login_popup.dart new file mode 100644 index 00000000..c9d1b67b --- /dev/null +++ b/mih_ui/lib/mih_packages/mih_home/components/mih_soft_login_popup.dart @@ -0,0 +1,173 @@ +import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; +import 'package:mih_package_toolkit/mih_package_toolkit.dart'; +import 'package:mzansi_innovation_hub/main.dart'; +import 'package:mzansi_innovation_hub/mih_config/mih_env.dart'; +import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart'; +import 'package:mzansi_innovation_hub/mih_services/mih_alert_services.dart'; +import 'package:mzansi_innovation_hub/mih_services/mih_authentication_services.dart'; +import 'package:mzansi_innovation_hub/mih_services/mih_validation_services.dart'; +import 'package:provider/provider.dart'; + +class MihSoftLoginPopup extends StatefulWidget { + const MihSoftLoginPopup({super.key}); + + @override + State createState() => _MihSoftLoginPopupState(); +} + +class _MihSoftLoginPopupState extends State { + final emailController = TextEditingController(); + final passwordController = TextEditingController(); + final _formKey = GlobalKey(); + + void autoFillTestUser() { + setState(() { + emailController.text = "test@mzansi-innovation-hub.co.za"; + passwordController.text = "Testprofile@1234"; + }); + } + + //sign user in + Future signUserIn() async { + MzansiProfileProvider profileProvider = + context.read(); + try { + bool successfulSignIn = await MihAuthenticationServices().signUserIn( + emailController.text, + passwordController.text, + context, + ); + if (!successfulSignIn) { + MihAlertServices().loginErrorAlert(context); + passwordController.clear(); + } else { + await profileProvider.syncWithMihServerData(); + context.pop(true); + } + } on Exception { + context.pop(); + MihAlertServices().internetConnectionAlert(context); + passwordController.clear(); + } + } + + @override + Widget build(BuildContext context) { + double width = MediaQuery.of(context).size.width; + return MihPackageWindow( + fullscreen: false, + windowTitle: null, + onWindowTapClose: () { + context.pop(); + }, + windowBody: MihSingleChildScroll( + scrollbarOn: false, + child: Padding( + padding: + MzansiInnovationHub.of(context)!.theme.screenType == "desktop" + ? EdgeInsets.symmetric(horizontal: width * 0.05) + : EdgeInsets.symmetric(horizontal: width * 0), + child: Column( + children: [ + Icon( + Icons.lock, + size: 100, + color: MihColors.secondary(), + ), + const SizedBox(height: 10), + Text( + 'Sign In', + style: TextStyle( + fontSize: 25, + fontWeight: FontWeight.bold, + color: MihColors.secondary(), + ), + ), + const SizedBox(height: 10), + MihForm( + formKey: _formKey, + formFields: [ + MihTextFormField( + fillColor: MihColors.secondary(), + inputColor: MihColors.primary(), + controller: emailController, + multiLineInput: false, + requiredText: true, + hintText: "Email", + autofillHints: const [AutofillHints.email], + validator: (value) { + return MihValidationServices().validateEmail(value); + }, + ), + const SizedBox(height: 10), + MihTextFormField( + fillColor: MihColors.secondary(), + inputColor: MihColors.primary(), + controller: passwordController, + multiLineInput: false, + requiredText: true, + hintText: "Password", + passwordMode: true, + autofillHints: const [AutofillHints.password], + validator: (value) { + return MihValidationServices().validatePassword(value); + }, + ), + const SizedBox(height: 20), + Center( + child: Wrap( + alignment: WrapAlignment.center, + runAlignment: WrapAlignment.center, + spacing: 10, + runSpacing: 10, + children: [ + MihButton( + onPressed: () { + if (_formKey.currentState!.validate()) { + signUserIn(); + } else { + MihAlertServices().inputErrorAlert(context); + } + }, + buttonColor: MihColors.green(), + width: 300, + child: Text( + "Sign In", + style: TextStyle( + color: MihColors.primary(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + ), + const SizedBox(height: 10), + if (AppEnviroment.getEnv() == "Dev") + MihButton( + onPressed: () { + autoFillTestUser(); + }, + buttonColor: MihColors.yellow(), + width: 300, + child: Text( + "Autofill", + style: TextStyle( + color: MihColors.primary(), + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + ), + ], + ), + ), + const SizedBox(height: 20), + ], + ), + ], + ), + ), + ), + ); + } +} diff --git a/mih_ui/lib/mih_packages/mih_home/mih_home.dart b/mih_ui/lib/mih_packages/mih_home/mih_home.dart index 8d4cdd50..d8c0d5a7 100644 --- a/mih_ui/lib/mih_packages/mih_home/mih_home.dart +++ b/mih_ui/lib/mih_packages/mih_home/mih_home.dart @@ -1,6 +1,7 @@ import 'package:mih_package_toolkit/mih_package_toolkit.dart'; import 'package:mzansi_innovation_hub/mih_objects/user_consent.dart'; import 'package:mzansi_innovation_hub/mih_package_components/mih_circle_avatar.dart'; +import 'package:mzansi_innovation_hub/mih_packages/mih_home/components/mih_soft_login_popup.dart'; import 'package:mzansi_innovation_hub/mih_packages/mih_home/components/mih_user_consent_window.dart'; import 'package:mzansi_innovation_hub/mih_providers/about_mih_provider.dart'; import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart'; @@ -10,6 +11,7 @@ import 'package:mzansi_innovation_hub/mih_packages/mih_home/package_tools/mih_pe import 'package:flutter/material.dart'; import 'package:mzansi_innovation_hub/mih_providers/mzansi_wallet_provider.dart'; import 'package:provider/provider.dart'; +import 'package:supertokens_flutter/supertokens.dart'; class MihHome extends StatefulWidget { const MihHome({ @@ -24,6 +26,46 @@ class _MihHomeState extends State { DateTime latestPrivacyPolicyDate = DateTime.parse("2024-12-01"); DateTime latestTermOfServiceDate = DateTime.parse("2024-12-01"); + Future globalMihDataSync( + MzansiProfileProvider mzansiProfileProvider) async { + MzansiWalletProvider walletProvider = context.read(); + AboutMihProvider aboutProvider = context.read(); + final bool isUserSignedIn = await SuperTokens.doesSessionExist(); + if (!isUserSignedIn) { + if (!context.mounted) return; + final bool didReauthenticate = await showDialog( + context: context, + barrierDismissible: false, + builder: (BuildContext context) => const MihSoftLoginPopup(), + ) ?? + false; + if (!didReauthenticate) { + if (context.mounted) { + ScaffoldMessenger.of(context).showSnackBar( + MihSnackBar( + child: const Text("Sync paused: Please log in to sync changes."), + ), + ); + } + return; // Stop execution here; local data remains safe + } + } + await mzansiProfileProvider.syncWithMihServerData(); + await walletProvider.syncWithMihServerData(mzansiProfileProvider); + bool success = await aboutProvider.syncWithMihServerData(); + if (context.mounted) { + ScaffoldMessenger.of(context).showSnackBar( + MihSnackBar( + child: Text( + success + ? "Data Synced with MIH Cloud." + : "MIH App operation in Offline Mode", + ), + ), + ); + } + } + bool showPolicyWindow(UserConsent? userConsent) { if (userConsent == null) { return true; @@ -46,8 +88,8 @@ class _MihHomeState extends State { if (mzansiProfileProvider.user == null) { await mzansiProfileProvider.syncWithMihServerData(); } - if(mzansiProfileProvider.isLocalModificationsPending()){ - mzansiProfileProvider.syncWithMihServerData(); + if (mzansiProfileProvider.isLocalModificationsPending()) { + mzansiProfileProvider.syncWithMihServerData(); } } @@ -91,26 +133,7 @@ class _MihHomeState extends State { RefreshIndicator( key: mzansiProfileProvider.refreshIndicatorKey, onRefresh: () async { - MzansiWalletProvider walletProvider = - context.read(); - AboutMihProvider aboutProvider = - context.read(); - await mzansiProfileProvider.syncWithMihServerData(); - await walletProvider - .syncWithMihServerData(mzansiProfileProvider); - bool success = await aboutProvider.syncWithMihServerData(); - if (context.mounted) { - ScaffoldMessenger.of(context).showSnackBar( - MihSnackBar( - child: Text( - success - ? "Data Synced with MIH Server." - : "MIH App operation in Offline Mode", - ), - // backgroundColor: success ? null : MihColors.red(), - ), - ); - } + await globalMihDataSync(mzansiProfileProvider); }, child: SingleChildScrollView( physics: const AlwaysScrollableScrollPhysics(), diff --git a/mih_ui/lib/mih_packages/mzansi_wallet/package_tools/mih_cards.dart b/mih_ui/lib/mih_packages/mzansi_wallet/package_tools/mih_cards.dart index 71f715c0..d9c038c5 100644 --- a/mih_ui/lib/mih_packages/mzansi_wallet/package_tools/mih_cards.dart +++ b/mih_ui/lib/mih_packages/mzansi_wallet/package_tools/mih_cards.dart @@ -185,7 +185,7 @@ class _MihCardsState extends State { MihSnackBar( child: Text( success - ? "Wallet Synced with MIH Server." + ? "Wallet Synced with MIH Cloud." : "MIH App operation in Offline Mode", ), // backgroundColor: success ? null : MihColors.red(), diff --git a/mih_ui/lib/mih_providers/mzansi_profile_provider.dart b/mih_ui/lib/mih_providers/mzansi_profile_provider.dart index 4ed23cf2..5f8c73db 100644 --- a/mih_ui/lib/mih_providers/mzansi_profile_provider.dart +++ b/mih_ui/lib/mih_providers/mzansi_profile_provider.dart @@ -48,7 +48,6 @@ class MzansiProfileProvider extends ChangeNotifier { business = _hiveData.getCachedBusiness(); businessUser = _hiveData.getCachedBusinessUser(); if (user != null && user!.pro_pic_path.isNotEmpty) { - KenLogger.success("proPicPath: ${user!.pro_pic_path}| THis is it"); userProfilePicUrl = MihFileApi.getMinioFileUrlV2(user!.pro_pic_path); userProfilePicture = CachedNetworkImageProvider(userProfilePicUrl!); } @@ -85,10 +84,14 @@ class MzansiProfileProvider extends ChangeNotifier { refreshIndicatorKey.currentState?.show(); } - bool isLocalModificationsPending(){ + bool isLocalModificationsPending() { return _hiveData.isModificationsNotEmpty(); } + bool hasLocalProfile() { + return _hiveData.hasCachedProfile(); + } + Future addUserConsent(UserConsent newConsent) async { bool success = await _hiveData.addUserConsentLocally(newConsent); await _hiveData.queuAddConsentModification(newConsent); diff --git a/mih_ui/lib/mih_services/mih_user_services.dart b/mih_ui/lib/mih_services/mih_user_services.dart index 3d909ed3..1a4d8d3e 100644 --- a/mih_ui/lib/mih_services/mih_user_services.dart +++ b/mih_ui/lib/mih_services/mih_user_services.dart @@ -63,6 +63,7 @@ class MihUserServices { }), ); if (response.statusCode == 201) { + await context.read().syncWithMihServerData(); context.goNamed( 'mihHome', extra: true,