Remove store state to refresh in FCM
Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
|
||||
import 'package:core/presentation/state/failure.dart';
|
||||
import 'package:core/presentation/state/success.dart';
|
||||
|
||||
class StoreEmailStateToRefreshLoading extends UIState {}
|
||||
|
||||
class StoreEmailStateToRefreshSuccess extends UIState {}
|
||||
|
||||
class StoreEmailStateToRefreshFailure extends FeatureFailure {
|
||||
|
||||
StoreEmailStateToRefreshFailure(dynamic exception) : super(exception: exception);
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
|
||||
import 'package:core/presentation/state/failure.dart';
|
||||
import 'package:core/presentation/state/success.dart';
|
||||
|
||||
class StoreMailboxStateToRefreshLoading extends UIState {}
|
||||
|
||||
class StoreMailboxStateToRefreshSuccess extends UIState {}
|
||||
|
||||
class StoreMailboxStateToRefreshFailure extends FeatureFailure {
|
||||
|
||||
StoreMailboxStateToRefreshFailure(dynamic exception) : super(exception: exception);
|
||||
}
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
import 'package:core/presentation/state/failure.dart';
|
||||
import 'package:core/presentation/state/success.dart';
|
||||
import 'package:dartz/dartz.dart';
|
||||
import 'package:fcm/model/type_name.dart';
|
||||
import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/state.dart' as jmap;
|
||||
import 'package:jmap_dart_client/jmap/core/user_name.dart';
|
||||
import 'package:tmail_ui_user/features/push_notification/domain/repository/fcm_repository.dart';
|
||||
import 'package:tmail_ui_user/features/push_notification/domain/state/store_email_state_to_refresh_state.dart';
|
||||
|
||||
class StoreEmailStateToRefreshInteractor {
|
||||
final FCMRepository _fcmRepository;
|
||||
|
||||
StoreEmailStateToRefreshInteractor(this._fcmRepository);
|
||||
|
||||
Stream<Either<Failure, Success>> execute(AccountId accountId, UserName userName, jmap.State newState) async* {
|
||||
try {
|
||||
yield Right<Failure, Success>(StoreEmailStateToRefreshLoading());
|
||||
await _fcmRepository.storeStateToRefresh(accountId, userName, TypeName.emailType, newState);
|
||||
yield Right<Failure, Success>(StoreEmailStateToRefreshSuccess());
|
||||
} catch (e) {
|
||||
yield Left<Failure, Success>(StoreEmailStateToRefreshFailure(e));
|
||||
}
|
||||
}
|
||||
}
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
import 'package:core/presentation/state/failure.dart';
|
||||
import 'package:core/presentation/state/success.dart';
|
||||
import 'package:dartz/dartz.dart';
|
||||
import 'package:fcm/model/type_name.dart';
|
||||
import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/state.dart' as jmap;
|
||||
import 'package:jmap_dart_client/jmap/core/user_name.dart';
|
||||
import 'package:tmail_ui_user/features/push_notification/domain/repository/fcm_repository.dart';
|
||||
import 'package:tmail_ui_user/features/push_notification/domain/state/store_mailbox_state_to_refresh_state.dart';
|
||||
|
||||
class StoreMailboxStateToRefreshInteractor {
|
||||
final FCMRepository _fcmRepository;
|
||||
|
||||
StoreMailboxStateToRefreshInteractor(this._fcmRepository);
|
||||
|
||||
Stream<Either<Failure, Success>> execute(AccountId accountId, UserName userName, jmap.State newState) async* {
|
||||
try {
|
||||
yield Right<Failure, Success>(StoreMailboxStateToRefreshLoading());
|
||||
await _fcmRepository.storeStateToRefresh(accountId, userName, TypeName.mailboxType, newState);
|
||||
yield Right<Failure, Success>(StoreMailboxStateToRefreshSuccess());
|
||||
} catch (e) {
|
||||
yield Left<Failure, Success>(StoreMailboxStateToRefreshFailure(e));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user