mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 15:17:31 +00:00
refactor: update function handling in routine dialogs
This commit is contained in:
@ -117,10 +117,22 @@ class ACHelper {
|
||||
},
|
||||
onConfirm: state.addedFunctions.isNotEmpty
|
||||
? () {
|
||||
final selectedFunctionData =
|
||||
state.addedFunctions.firstWhere(
|
||||
(f) =>
|
||||
f.functionCode == state.selectedFunction,
|
||||
orElse: () => DeviceFunctionData(
|
||||
entityId: '',
|
||||
functionCode: state.selectedFunction ?? '',
|
||||
operationName: '',
|
||||
value: null,
|
||||
),
|
||||
);
|
||||
|
||||
/// add the functions to the routine bloc
|
||||
context.read<RoutineBloc>().add(
|
||||
AddFunctionToRoutine(
|
||||
state.addedFunctions,
|
||||
[selectedFunctionData],
|
||||
uniqueCustomId,
|
||||
),
|
||||
);
|
||||
|
Reference in New Issue
Block a user