From e59001784dc7f67982a86117a1034fdcc8b8f01f Mon Sep 17 00:00:00 2001 From: Jonas Franz Date: Sun, 16 Sep 2018 22:19:43 +0200 Subject: [PATCH] Fix a bug causing to not-start at new devices --- lib/global.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/global.dart b/lib/global.dart index 79e5fe7..069b278 100644 --- a/lib/global.dart +++ b/lib/global.dart @@ -63,10 +63,11 @@ class VikunjaGlobalState extends State { 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;