diff --git a/.vscode/launch.json b/.vscode/launch.json index 8cc3a0f..70febd0 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -10,7 +10,7 @@ "request": "launch", "type": "dart", "toolArgs": [ - "--dart-define=APPVER=$(cat pubspec.yaml | grep version: | cut -d' ' -f2 | cut -d+ -f1)" + "--dart-define=APPVER=$(cat pubspec.yaml | grep version: | cut -d' ' -f2 | cut -d+ -f1) --release" ] } ] diff --git a/filcnaplo_mobile_ui/lib/common/profile_image/profile_button.dart b/filcnaplo_mobile_ui/lib/common/profile_image/profile_button.dart index b685862..59b59ae 100755 --- a/filcnaplo_mobile_ui/lib/common/profile_image/profile_button.dart +++ b/filcnaplo_mobile_ui/lib/common/profile_image/profile_button.dart @@ -43,7 +43,12 @@ class ProfileButton extends StatelessWidget { user = Provider.of(context); try { - account = user.getUsers()[1]; + user.getUsers().forEach((acc) { + if (user.name!.toLowerCase().replaceAll(' ', '') != + acc.name.toLowerCase().replaceAll(' ', '')) { + account = acc; + } + }); } catch (err) { account = null; } @@ -83,7 +88,7 @@ class ProfileButton extends StatelessWidget { }, onDoubleTap: () { if (account != null) { - user.setUser(account.id); + user.setUser(account!.id); restore().then((_) => user.setUser(account!.id)); } },