TF-1933 Combine cache and server when get session
(cherry picked from commit 05e8ba3d5110c311eae5db0120ea3a9128b7b5d5)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user