TF-1933 Combine cache and server when get session

(cherry picked from commit 05e8ba3d5110c311eae5db0120ea3a9128b7b5d5)
This commit is contained in:
dab246
2023-06-27 21:55:46 +07:00
committed by Dat Vu
parent 2fcfc4ff0b
commit 9b735ebf59
3 changed files with 9 additions and 6 deletions
@@ -1,6 +1,8 @@
import 'package:core/core.dart';
import 'package:jmap_dart_client/jmap/core/session/session.dart';
class GetSessionLoading extends UIState {}
class GetSessionSuccess extends UIState {
final Session session;
@@ -11,6 +11,7 @@ class GetSessionInteractor {
Stream<Either<Failure, Success>> execute() async* {
try {
yield Right<Failure, Success>(GetSessionLoading());
final session = await sessionRepository.getSession();
yield Right<Failure, Success>(GetSessionSuccess(session));
} catch (e) {