Skip to content

Commit

Permalink
Merge pull request #121 from brilliantlabsAR/bug_fix
Browse files Browse the repository at this point in the history
unknown state after logout/delete fixed
  • Loading branch information
siliconwitch authored Jun 5, 2024
2 parents 820cdac + b846b53 commit af4bfe0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
22 changes: 14 additions & 8 deletions lib/models/app_logic_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -689,10 +689,13 @@ class AppLogicModel extends ChangeNotifier {
try {
await _connectedDevice?.disconnect();
await NoaApi.signOut((await _getUserAuthToken())!);
} catch (_) {}
await SharedPreferences.getInstance().then((sp) => sp.clear());
noaMessages.clear();
triggerEvent(Event.done);
await SharedPreferences.getInstance().then((sp) => sp.clear());
noaMessages.clear();
triggerEvent(Event.done);
} catch (error) {
_log.warning("Error logging out. $error");
triggerEvent(Event.done);
}
});
state.changeOn(Event.done, State.getUserSettings);
break;
Expand All @@ -702,10 +705,13 @@ class AppLogicModel extends ChangeNotifier {
try {
await _connectedDevice?.disconnect();
await NoaApi.deleteUser((await _getUserAuthToken())!);
} catch (_) {}
await SharedPreferences.getInstance().then((sp) => sp.clear());
noaMessages.clear();
triggerEvent(Event.done);
await SharedPreferences.getInstance().then((sp) => sp.clear());
noaMessages.clear();
triggerEvent(Event.done);
} catch (error) {
_log.warning("Error deleting account. $error");
triggerEvent(Event.done);
}
});
state.changeOn(Event.done, State.getUserSettings);
break;
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: noa
description: "A new Flutter project."
publish_to: 'none'
version: 1.3.4
version: 1.3.5

environment:
sdk: '>=3.3.1 <4.0.0'
Expand Down

0 comments on commit af4bfe0

Please sign in to comment.