TF-3416 Handle open EML attachment in EML previewer
This commit is contained in:
@@ -2016,12 +2016,16 @@ class SingleEmailController extends BaseController with AppLoaderMixin {
|
||||
SmartDialog.dismiss();
|
||||
|
||||
if (PlatformInfo.isWeb) {
|
||||
HtmlUtils.openNewWindowByUrl(
|
||||
bool isOpen = HtmlUtils.openNewWindowByUrl(
|
||||
RouteUtils.createUrlWebLocationBar(
|
||||
AppRoutes.emailEMLPreviewer,
|
||||
previewId: success.storeKey
|
||||
).toString(),
|
||||
);
|
||||
|
||||
if (!isOpen) {
|
||||
toastManager.showMessageFailure(PreviewEmailFromEmlFileFailure(CannotOpenNewWindowException()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'eml_previewer.g.dart';
|
||||
|
||||
@JsonSerializable(explicitToJson: true, includeIfNull: false)
|
||||
class EMLPreviewer with EquatableMixin {
|
||||
final String title;
|
||||
final String content;
|
||||
|
||||
EMLPreviewer({required this.title, required this.content});
|
||||
|
||||
factory EMLPreviewer.fromJson(Map<String, dynamic> json) => _$EMLPreviewerFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$EMLPreviewerToJson(this);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [title, content];
|
||||
}
|
||||
Reference in New Issue
Block a user