This commit is contained in:
Stephan Richter
2021-06-18 09:38:45 +02:00
parent ebaadd2a2d
commit db94d55cbc
3 changed files with 4 additions and 3 deletions

View File

@@ -40,8 +40,8 @@ public class FunctionList extends HashSet<Function> implements Constants{
public FunctionList toggle(String name) {
boolean enabled = !enabledFunctions.remove(name);
if (enabled) enabledFunctions.add(name);
stream().filter(fun -> name.equals(fun.name())).forEach(fun -> fun.setState(enabled));
if (enabled) enabledFunctions.add(name);
for (Function fun : with(name)) fun.setState(enabled);
return this;
}