TF-4004 Add loading bar for email rule filter view

This commit is contained in:
dab246
2025-09-09 04:17:36 +07:00
committed by Dat H. Pham
parent 5983fb66ff
commit dab3dc3b99
4 changed files with 41 additions and 7 deletions
@@ -2,6 +2,8 @@ import 'package:core/presentation/state/failure.dart';
import 'package:core/presentation/state/success.dart';
import 'package:rule_filter/rule_filter/tmail_rule.dart';
class GettingAllRules extends LoadingState {}
class GetAllRulesSuccess extends UIState {
final List<TMailRule>? rules;
@@ -13,7 +13,7 @@ class GetAllRulesInteractor {
Stream<Either<Failure, Success>> execute(AccountId accountId) async* {
try {
yield Right<Failure, Success>(LoadingState());
yield Right(GettingAllRules());
final rulesResponse = await _ruleFilterRepository.getAllTMailRule(accountId);
yield Right(GetAllRulesSuccess(rulesResponse));
} catch (exception) {