refactor: rename LoginState.logged to loggedIn

This commit is contained in:
Jindřich Pikora 2021-08-03 12:26:17 +00:00 committed by Nicolas Werner
parent 5ba63f1bc0
commit cf441e533d
3 changed files with 6 additions and 6 deletions

View File

@ -21,7 +21,7 @@ class FamedlySdkExampleApp extends StatelessWidget {
if (snapshot.hasError) { if (snapshot.hasError) {
return Center(child: Text(snapshot.error.toString())); return Center(child: Text(snapshot.error.toString()));
} }
if (snapshot.data == LoginState.logged) { if (snapshot.data == LoginState.loggedIn) {
return ChatListView(); return ChatListView();
} }
return LoginView(); return LoginView();

View File

@ -43,7 +43,7 @@ import 'utils/multilock.dart';
typedef RoomSorter = int Function(Room a, Room b); typedef RoomSorter = int Function(Room a, Room b);
enum LoginState { logged, loggedOut } enum LoginState { loggedIn, loggedOut }
extension TrailingSlash on Uri { extension TrailingSlash on Uri {
Uri stripTrailingSlash() => path.endsWith('/') Uri stripTrailingSlash() => path.endsWith('/')
@ -838,10 +838,10 @@ class Client extends MatrixApi {
/// Before you can connect you need at least an [accessToken], a [homeserver], /// Before you can connect you need at least an [accessToken], a [homeserver],
/// a [userID], a [deviceID], and a [deviceName]. /// a [userID], a [deviceID], and a [deviceName].
/// ///
/// Usually you don't need to call this method by yourself because [login()], [register()] /// Usually you don't need to call this method yourself because [login()], [register()]
/// and even the constructor calls it. /// and even the constructor calls it.
/// ///
/// Sends [LoginState.logged] to [onLoginStateChanged]. /// Sends [LoginState.loggedIn] to [onLoginStateChanged].
/// ///
/// If one of [newToken], [newUserID], [newDeviceID], [newDeviceName] is set then /// If one of [newToken], [newUserID], [newDeviceID], [newDeviceName] is set then
/// all of them must be set! If you don't set them, this method will try to /// all of them must be set! If you don't set them, this method will try to
@ -967,7 +967,7 @@ class Client extends MatrixApi {
presences.clear(); presences.clear();
} }
_initLock = false; _initLock = false;
_loginState = LoginState.logged; _loginState = LoginState.loggedIn;
Logs().i( Logs().i(
'Successfully connected as ${userID.localpart} with ${homeserver.toString()}', 'Successfully connected as ${userID.localpart} with ${homeserver.toString()}',
); );

View File

@ -113,7 +113,7 @@ void main() {
final firstSync = await firstSyncFuture; final firstSync = await firstSyncFuture;
final sync = await syncFuture; final sync = await syncFuture;
expect(loginState, LoginState.logged); expect(loginState, LoginState.loggedIn);
expect(firstSync, true); expect(firstSync, true);
expect(matrix.encryptionEnabled, olmEnabled); expect(matrix.encryptionEnabled, olmEnabled);
if (olmEnabled) { if (olmEnabled) {