Use TupleKey(ObjectKey-AccountId-UserName) to store data to hive
(cherry picked from commit e0ace535d5f3af71eb13598d92524caf2c6d9bbf)
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/id.dart';
|
||||
import 'package:model/account/account.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/user_name.dart';
|
||||
import 'package:model/account/authentication_type.dart';
|
||||
import 'package:model/account/personal_account.dart';
|
||||
import 'package:tmail_ui_user/features/login/data/model/account_cache.dart';
|
||||
|
||||
extension AccountCacheExtension on AccountCache {
|
||||
@@ -15,14 +16,14 @@ extension AccountCacheExtension on AccountCache {
|
||||
}
|
||||
}
|
||||
|
||||
Account toAccount() {
|
||||
PersonalAccount toAccount() {
|
||||
final authenticationType = fromAuthenticationTypeString();
|
||||
return Account(
|
||||
return PersonalAccount(
|
||||
id,
|
||||
authenticationType,
|
||||
isSelected: isSelected,
|
||||
accountId: accountId != null ? AccountId(Id(accountId!)) : null,
|
||||
apiUrl: apiUrl
|
||||
);
|
||||
apiUrl: apiUrl,
|
||||
userName: userName != null ? UserName(userName!) : null);
|
||||
}
|
||||
}
|
||||
+4
-4
@@ -1,15 +1,15 @@
|
||||
import 'package:model/account/account.dart';
|
||||
import 'package:model/account/authentication_type.dart';
|
||||
import 'package:model/account/personal_account.dart';
|
||||
import 'package:tmail_ui_user/features/login/data/model/account_cache.dart';
|
||||
|
||||
extension AccountExtensions on Account {
|
||||
extension PersonalAccountExtension on PersonalAccount {
|
||||
AccountCache toCache() {
|
||||
return AccountCache(
|
||||
id,
|
||||
authenticationType.asString(),
|
||||
isSelected: isSelected,
|
||||
accountId: accountId?.id.value,
|
||||
apiUrl: apiUrl
|
||||
);
|
||||
apiUrl: apiUrl,
|
||||
userName: userName?.value);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user