TF-78 Implement mark as unread when touch the "eye slash" icon on the top of screen EmailView
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
|
||||
enum ReadActions {
|
||||
markAsRead,
|
||||
markAsUnread
|
||||
}
|
||||
@@ -1,8 +1,15 @@
|
||||
import 'package:jmap_dart_client/jmap/core/patch_object.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/email/keyword_identifier.dart';
|
||||
import 'package:model/email/read_actions.dart';
|
||||
|
||||
extension KeyWordIdentifierExtension on KeyWordIdentifier {
|
||||
String generatePath() {
|
||||
String _generatePath() {
|
||||
return '${PatchObject.keywordsProperty}/$value';
|
||||
}
|
||||
|
||||
PatchObject generateReadActionPath(ReadActions readActions) {
|
||||
return PatchObject({
|
||||
_generatePath(): readActions == ReadActions.markAsRead ? true : null
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -14,10 +14,10 @@ extension PresentationEmailExtension on PresentationEmail {
|
||||
return '';
|
||||
}
|
||||
|
||||
PresentationEmail markAsReadPresentationEmail({required bool isUnread}) {
|
||||
PresentationEmail markAsReadPresentationEmail(ReadActions readActions) {
|
||||
var newKeyWord = keywords;
|
||||
|
||||
if (isUnread) {
|
||||
if (readActions == ReadActions.markAsUnread) {
|
||||
newKeyWord?.removeWhere((key, value) => key == KeyWordIdentifier.emailSeen);
|
||||
} else {
|
||||
if (newKeyWord == null) {
|
||||
|
||||
@@ -27,6 +27,7 @@ export 'email/prefix_email_address.dart';
|
||||
export 'email/email_action_type.dart';
|
||||
export 'email/presentation_email_address.dart';
|
||||
export 'email/email_address_cache.dart';
|
||||
export 'email/read_actions.dart';
|
||||
|
||||
// Extensions
|
||||
export 'extensions/email_address_extension.dart';
|
||||
|
||||
Reference in New Issue
Block a user