TF-1363: [Presentation]: Implement enable or disable spam report for Mobile
This commit is contained in:
@@ -1,16 +1,13 @@
|
||||
enum SpamReportState {
|
||||
enabled,
|
||||
disabled,
|
||||
}
|
||||
|
||||
extension SpamReportStateExtension on SpamReportState {
|
||||
|
||||
disabled;
|
||||
|
||||
String get keyValue {
|
||||
switch(this) {
|
||||
case SpamReportState.enabled:
|
||||
return 'enabled';
|
||||
case SpamReportState.disabled:
|
||||
return 'disabled';
|
||||
switch(this) {
|
||||
case SpamReportState.enabled:
|
||||
return 'enabled';
|
||||
case SpamReportState.disabled:
|
||||
return 'disabled';
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -12,7 +12,7 @@ class DeleteLastTimeDismissedSpamReportedInteractor {
|
||||
Stream<Either<Failure, Success>> execute() async* {
|
||||
try {
|
||||
yield Right<Failure, Success>(DeleteLastTimeDismissedSpamReportedLoading());
|
||||
await _spamReportRepository.deleteLastTimeDismissedSpamReported();
|
||||
await _spamReportRepository.deleteLastTimeDismissedSpamReported();
|
||||
yield Right<Failure, Success>(DeleteLastTimeDismissedSpamReportedSuccess());
|
||||
} catch (e) {
|
||||
yield Left<Failure, Success>(DeleteLastTimeDismissedSpamReportedFailure(e));
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ class DeleteSpamReportStateInteractor {
|
||||
Stream<Either<Failure, Success>> execute() async* {
|
||||
try {
|
||||
yield Right<Failure, Success>(DeleteSpamReportStateLoading());
|
||||
await _spamReportRepository.deleteSpamReportState();
|
||||
await _spamReportRepository.deleteSpamReportState();
|
||||
yield Right<Failure, Success>(DeleteSpamReportStateSuccess());
|
||||
} catch (e) {
|
||||
yield Left<Failure, Success>(DeleteSpamReportStateFailure(e));
|
||||
|
||||
+2
-2
@@ -1527,7 +1527,7 @@ class MailboxDashBoardController extends ReloadableController {
|
||||
dispatchAction(OpenSpamMailboxAction(context, presentationMailbox));
|
||||
}
|
||||
|
||||
bool get enableSpamRepot => spamReportController.enableSpamReport;
|
||||
bool get enableSpamReport => spamReportController.enableSpamReport;
|
||||
|
||||
void _showSpamReportbanner() {
|
||||
if (spamReportController.enableSpamReport) {
|
||||
@@ -1536,7 +1536,7 @@ class MailboxDashBoardController extends ReloadableController {
|
||||
}
|
||||
|
||||
void storeSpamReportStateAction() {
|
||||
final _storeSpamReportState = enableSpamRepot ? SpamReportState.disabled : SpamReportState.enabled;
|
||||
final _storeSpamReportState = enableSpamReport ? SpamReportState.disabled : SpamReportState.enabled;
|
||||
spamReportController.storeSpamReportStateAction(_storeSpamReportState);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user