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,
);
},
appName: "Setup Business",
appName: "Set Up Business",
appIcon: Icon(
MihIcons.profileSetup,
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),

View File

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