Browse Source

refactor(neon,app): Drop unused loginName

pull/526/head
jld3103 1 year ago
parent
commit
11f75cfc19
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 2
      packages/app/integration_test/screenshot_test.dart
  2. 1
      packages/neon/neon/lib/src/blocs/login_check_account.dart
  3. 6
      packages/neon/neon/lib/src/models/account.dart

2
packages/app/integration_test/screenshot_test.dart

@ -129,7 +129,6 @@ Future main() async {
final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized(); final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized();
final account = Account( final account = Account(
serverURL: 'http://10.0.2.2', serverURL: 'http://10.0.2.2',
loginName: 'user1',
username: 'user1', username: 'user1',
password: 'user1', password: 'user1',
); );
@ -346,7 +345,6 @@ Future main() async {
testWidgets('notifications', (final tester) async { testWidgets('notifications', (final tester) async {
await Account( await Account(
serverURL: 'http://10.0.2.2', serverURL: 'http://10.0.2.2',
loginName: 'admin',
username: 'admin', username: 'admin',
password: 'admin', password: 'admin',
).client.notifications.sendAdminNotification( ).client.notifications.sendAdminNotification(

1
packages/neon/neon/lib/src/blocs/login_check_account.dart

@ -53,7 +53,6 @@ class LoginCheckAccountBloc extends InteractiveBloc
final account = Account( final account = Account(
serverURL: serverURL, serverURL: serverURL,
loginName: loginName,
username: response.ocs.data.id, username: response.ocs.data.id,
password: password, password: password,
userAgent: neonUserAgent, userAgent: neonUserAgent,

6
packages/neon/neon/lib/src/models/account.dart

@ -27,14 +27,12 @@ abstract interface class Credentials {
class Account implements Credentials { class Account implements Credentials {
Account({ Account({
required this.serverURL, required this.serverURL,
required this.loginName,
required this.username, required this.username,
this.password, this.password,
this.userAgent, this.userAgent,
}) : _client = NextcloudClient( }) : _client = NextcloudClient(
serverURL, serverURL,
loginName: loginName, loginName: username,
username: username,
password: password, password: password,
userAgentOverride: userAgent, userAgentOverride: userAgent,
cookieJar: CookieJar(), cookieJar: CookieJar(),
@ -45,7 +43,6 @@ class Account implements Credentials {
@override @override
final String serverURL; final String serverURL;
final String loginName;
@override @override
final String username; final String username;
@override @override
@ -56,7 +53,6 @@ class Account implements Credentials {
bool operator ==(final Object other) => bool operator ==(final Object other) =>
other is Account && other is Account &&
other.serverURL == serverURL && other.serverURL == serverURL &&
other.loginName == loginName &&
other.username == username && other.username == username &&
other.password == password && other.password == password &&
other.userAgent == userAgent; other.userAgent == userAgent;

Loading…
Cancel
Save