TF-4069 Automatically reply should be deactivated vacation after end date
This commit is contained in:
+9
-5
@@ -2015,12 +2015,16 @@ class MailboxDashBoardController extends ReloadableController
|
||||
downloadController.deleteDownloadTask(taskId);
|
||||
}
|
||||
|
||||
void disableVacationResponder() {
|
||||
void disableVacationResponder(VacationResponse vacationResponse) {
|
||||
if (accountId.value != null && _updateVacationInteractor != null) {
|
||||
final vacationDisabled = vacationResponse.value != null
|
||||
? vacationResponse.value!.copyWith(isEnabled: false)
|
||||
: VacationResponse(isEnabled: false);
|
||||
consumeState(_updateVacationInteractor!.execute(accountId.value!, vacationDisabled));
|
||||
consumeState(_updateVacationInteractor!.execute(
|
||||
accountId.value!,
|
||||
vacationResponse.clearAllExceptHtmlBody(),
|
||||
));
|
||||
} else {
|
||||
consumeState(
|
||||
Stream.value(Left(UpdateVacationFailure(ParametersIsNullException()))),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -617,12 +617,14 @@ class MailboxDashBoardView extends BaseMailboxDashBoardView {
|
||||
|
||||
Widget _buildVacationNotificationMessage(BuildContext context) {
|
||||
return Obx(() {
|
||||
if (controller.vacationResponse.value?.vacationResponderIsValid == true) {
|
||||
final vacation = controller.vacationResponse.value;
|
||||
if (vacation?.vacationResponderIsValid == true) {
|
||||
return VacationNotificationMessageWidget(
|
||||
margin: VacationNotificationMessageWidgetStyle.bannerMargin,
|
||||
vacationResponse: controller.vacationResponse.value!,
|
||||
vacationResponse: vacation!,
|
||||
actionGotoVacationSetting: controller.goToVacationSetting,
|
||||
actionEndNow: controller.disableVacationResponder);
|
||||
actionEndNow: controller.disableVacationResponder,
|
||||
);
|
||||
} else {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user