TF-2901 Implement caching composer on log out
This commit is contained in:
+6
-4
@@ -1,6 +1,8 @@
|
||||
import 'package:core/presentation/state/failure.dart';
|
||||
import 'package:core/presentation/state/success.dart';
|
||||
import 'package:dartz/dartz.dart';
|
||||
import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/user_name.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/domain/repository/composer_cache_repository.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/domain/state/get_composer_cache_state.dart';
|
||||
|
||||
@@ -9,12 +11,12 @@ class GetComposerCacheOnWebInteractor {
|
||||
|
||||
GetComposerCacheOnWebInteractor(this.composerCacheRepository);
|
||||
|
||||
Either<Failure, Success> execute() {
|
||||
Stream<Either<Failure, Success>> execute(AccountId accountId, UserName userName) async* {
|
||||
try {
|
||||
final data = composerCacheRepository.getComposerCacheOnWeb();
|
||||
return Right(GetComposerCacheSuccess(data));
|
||||
final data = await composerCacheRepository.getComposerCacheOnWeb(accountId, userName);
|
||||
yield Right(GetComposerCacheSuccess(data));
|
||||
} catch (exception) {
|
||||
return Left(GetComposerCacheFailure(exception));
|
||||
yield Left(GetComposerCacheFailure(exception));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user