TF-3719 Add handle export log to device if need
Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import 'package:core/presentation/state/failure.dart';
|
||||
import 'package:core/presentation/state/success.dart';
|
||||
import 'package:dartz/dartz.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/data/repository/trace_log_repository.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/domain/state/export_trace_log_state.dart';
|
||||
|
||||
class ExportTraceLogInteractor {
|
||||
final TraceLogRepository _traceLogRepository;
|
||||
|
||||
ExportTraceLogInteractor(this._traceLogRepository);
|
||||
|
||||
Stream<Either<Failure, Success>> execute() async* {
|
||||
try {
|
||||
yield Right<Failure, Success>(ExportTraceLogLoading());
|
||||
final savePath = await _traceLogRepository.exportTraceLog();
|
||||
yield Right<Failure, Success>(ExportTraceLogSuccess(savePath));
|
||||
} catch (exception) {
|
||||
yield Left<Failure, Success>(ExportTraceLogFailure(exception));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user