TF-3752 Better error handling when updating recipients in Forwarding
Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
@@ -11,11 +11,14 @@ class AddRecipientInForwardingRequest with EquatableMixin {
|
||||
});
|
||||
|
||||
TMailForward get newTMailForward {
|
||||
final newListRecipients = currentForward.forwards
|
||||
.where((recipient) => !listRecipientAdded.contains(recipient))
|
||||
.toSet();
|
||||
newListRecipients.addAll(listRecipientAdded);
|
||||
return currentForward.copyWith(forwards: newListRecipients);
|
||||
final currentRecipients = currentForward.forwards ?? {};
|
||||
|
||||
final updatedRecipients = {
|
||||
...currentRecipients,
|
||||
...listRecipientAdded,
|
||||
};
|
||||
|
||||
return currentForward.copyWith(forwards: updatedRecipients);
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
+4
-4
@@ -11,11 +11,11 @@ class DeleteRecipientInForwardingRequest with EquatableMixin {
|
||||
});
|
||||
|
||||
TMailForward get newTMailForward {
|
||||
final newListRecipients = currentForward.forwards
|
||||
.where((recipient) => !listRecipientDeleted.contains(recipient))
|
||||
.toSet();
|
||||
final currentRecipients = currentForward.forwards ?? {};
|
||||
|
||||
return currentForward.copyWith(forwards: newListRecipients);
|
||||
final updatedRecipients = currentRecipients.difference(listRecipientDeleted.toSet());
|
||||
|
||||
return currentForward.copyWith(forwards: updatedRecipients);
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
Reference in New Issue
Block a user