auto nav to business side on business account activation

This commit is contained in:
2025-08-05 11:51:53 +02:00
parent ef59345df7
commit deed8c8d8b
2 changed files with 13 additions and 2 deletions

View File

@@ -29,7 +29,7 @@ class _MzansiSetupBusinessProfileTileState
arguments: widget.signedInUser, arguments: widget.signedInUser,
); );
}, },
appName: "Setup Business", appName: "Set Up Business",
appIcon: Icon( appIcon: Icon(
MihIcons.profileSetup, MihIcons.profileSetup,
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(), color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),

View File

@@ -41,6 +41,7 @@ class _MihPersonalProfileState extends State<MihPersonalProfile> {
final ValueNotifier<int> _counter = ValueNotifier<int>(0); final ValueNotifier<int> _counter = ValueNotifier<int>(0);
PlatformFile? proPic; PlatformFile? proPic;
late ImageProvider<Object>? propicPreview; late ImageProvider<Object>? propicPreview;
late bool originalProfileTypeIsBusiness;
late bool businessUser; late bool businessUser;
late String oldProPicName; late String oldProPicName;
late String env; late String env;
@@ -125,13 +126,18 @@ class _MihPersonalProfileState extends State<MihPersonalProfile> {
context, context,
); );
if (responseCode == 200) { if (responseCode == 200) {
bool stayOnPersonalSide = true;
if (originalProfileTypeIsBusiness == false && businessUser == true) {
stayOnPersonalSide = false;
}
Navigator.of(context).pop(); Navigator.of(context).pop();
Navigator.of(context).pop(); Navigator.of(context).pop();
Navigator.of(context).pop(); Navigator.of(context).pop();
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
'/', '/',
arguments: AuthArguments( arguments: AuthArguments(
true, stayOnPersonalSide,
// true,
false, false,
), ),
); );
@@ -423,6 +429,11 @@ class _MihPersonalProfileState extends State<MihPersonalProfile> {
usernameController.text = widget.arguments.signedInUser.username; usernameController.text = widget.arguments.signedInUser.username;
purposeController.text = widget.arguments.signedInUser.purpose; purposeController.text = widget.arguments.signedInUser.purpose;
businessUser = isBusinessUser(); businessUser = isBusinessUser();
if (businessUser) {
originalProfileTypeIsBusiness = true;
} else {
originalProfileTypeIsBusiness = false;
}
}); });
} }