1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2025-06-19 00:05:16 +00:00

Change the way we determine whether current user is signed in or not

This commit is contained in:
2020-05-12 19:04:53 +02:00
parent c747d3c1ba
commit 17f271dfb9
2 changed files with 5 additions and 6 deletions

View File

@ -194,6 +194,9 @@ class AccountHelper {
_currentUserID = preferences.getInt(_USER_ID_PREFERENCE_NAME);
}
/// Check if current user ID is loaded or not
static bool get isUserIDLoaded => _currentUserID > 0;
/// Get the ID of the currently signed in user
static int getCurrentUserID() {
if (_currentUserID == -1) throw "Current user ID has not been loaded yet!";