TF-802 Disable vacation responder in notification message
This commit is contained in:
@@ -35,6 +35,7 @@ class VacationController extends BaseController {
|
||||
final TextEditingController messageBodyEditorController = TextEditingController();
|
||||
|
||||
VacationResponse? currentVacation;
|
||||
late Worker vacationWorker;
|
||||
|
||||
VacationController(
|
||||
this._getAllVacationInteractor,
|
||||
@@ -42,6 +43,12 @@ class VacationController extends BaseController {
|
||||
this._verifyNameInteractor
|
||||
);
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
_initWorker();
|
||||
super.onInit();
|
||||
}
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
_getAllVacation();
|
||||
@@ -65,6 +72,17 @@ class VacationController extends BaseController {
|
||||
@override
|
||||
void onError(error) {}
|
||||
|
||||
void _initWorker() {
|
||||
vacationWorker = ever(_accountDashBoardController.vacationResponse, (vacation) {
|
||||
if (vacation is VacationResponse) {
|
||||
currentVacation = vacation;
|
||||
final newVacationPresentation = currentVacation?.toVacationPresentation();
|
||||
vacationPresentation.value = newVacationPresentation ?? VacationPresentation.initialize();
|
||||
messageBodyEditorController.text = newVacationPresentation?.messageBody ?? '';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void _getAllVacation() {
|
||||
final accountId = _accountDashBoardController.accountId.value;
|
||||
if (accountId != null) {
|
||||
@@ -273,6 +291,7 @@ class VacationController extends BaseController {
|
||||
@override
|
||||
void onClose() {
|
||||
messageBodyEditorController.dispose();
|
||||
vacationWorker.dispose();
|
||||
super.onClose();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user