ToggleInstanceFeaturesCommandForm: Only issue a command for changes
This commit is contained in:
parent
caca219aa1
commit
3e5e6ec64e
|
@ -254,18 +254,19 @@ class ToggleInstanceFeaturesCommandForm extends CommandForm
|
|||
);
|
||||
|
||||
foreach ($this->getValues() as $feature => $enabled) {
|
||||
if ((bool) $this->status->{$feature} !== (bool) $enabled) {
|
||||
$toggleFeature = new ToggleInstanceFeatureCommand();
|
||||
$toggleFeature
|
||||
->setFeature($feature)
|
||||
->setEnabled($enabled);
|
||||
$this->getTransport($this->request)->send($toggleFeature);
|
||||
|
||||
if ((bool) $this->status->{$feature} !== (bool) $enabled) {
|
||||
Notification::success(
|
||||
$notifications[$feature][$enabled ? 0 : 1]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue