feat(Label): Add depend on settings to register websocket for label
This commit is contained in:
+19
@@ -1,3 +1,4 @@
|
||||
import 'package:core/utils/app_logger.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/controller/mailbox_dashboard_controller.dart';
|
||||
|
||||
@@ -15,4 +16,22 @@ extension HandleLogicLabelExtension on MailboxDashBoardController {
|
||||
return labelController.isLabelSettingEnabled.isTrue &&
|
||||
isLabelCapabilitySupported;
|
||||
}
|
||||
|
||||
void registerLabelReactiveObxListener() {
|
||||
workerObxVariables.add(
|
||||
ever(
|
||||
labelController.isLabelSettingEnabled,
|
||||
_onLabelSettingEnabledChanged,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void _onLabelSettingEnabledChanged(bool isEnabled) {
|
||||
log('$runtimeType::_onLabelSettingEnabledChanged: isEnabled is $isEnabled');
|
||||
injectWebSocket(
|
||||
session: sessionCurrent,
|
||||
accountId: accountId.value,
|
||||
isLabelAvailable: isEnabled,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user