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 502fd62dd9
commit 4bfd13536e
No known key found for this signature in database
GPG Key ID: 506AEEBE80BEDECD
1 changed files with 2 additions and 1 deletions

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;