Bug fixes

This commit is contained in:
Abdullah Alassaf
2024-12-03 12:01:17 +03:00
parent d5ad06335b
commit 7ee335ab1a
2 changed files with 66 additions and 124 deletions

View File

@ -150,13 +150,13 @@ class SaveRoutineHelper {
onCancel: () => Navigator.pop(context),
onConfirm: () async {
if (state.isAutomation) {
if (state.automationId != null) {
if (state.isUpdate ?? false) {
context.read<RoutineBloc>().add(const UpdateAutomation());
} else {
context.read<RoutineBloc>().add(const CreateAutomationEvent());
}
} else {
if (state.sceneId != null) {
if (state.isUpdate ?? false) {
context.read<RoutineBloc>().add(const UpdateScene());
} else {
context.read<RoutineBloc>().add(const CreateSceneEvent());