1
0
mirror of https://github.com/go-vikunja/app synced 2024-06-02 18:49:47 +00:00

Fix a bug causing to not-start at new devices

This commit is contained in:
Jonas Franz 2018-09-16 22:19:43 +02:00
parent 5af3e4cac7
commit e59001784d

View File

@ -63,10 +63,11 @@ class VikunjaGlobalState extends State<VikunjaGlobal> {
void _loadCurrentUser() async {
var currentUser = await _storage.read(key: 'currentUser');
var token;
var loadedCurrentUser;
if (currentUser != null) {
token = await _storage.read(key: currentUser);
loadedCurrentUser = await userService.get(int.tryParse(currentUser));
}
var loadedCurrentUser = await userService.get(int.tryParse(currentUser));
setState(() {
_currentUser = loadedCurrentUser;
_client = token != null ? Client(token) : null;