Skip to content

Commit a4ac5c2

Browse files
authored
Merge pull request #3 from elgentos/configuration-fix
Fixed configuration setup
2 parents 8e8bac9 + a08374b commit a4ac5c2

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Observer/UpdateFrontendConfiguration.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@ public function execute(Observer $observer)
2626
{
2727

2828
$storeId = $this->storeManager->getStore()->getStoreId();
29+
$configuration = $observer->getData('configuration');
2930

30-
return array_replace(
31-
(array)$observer->getData('configuration'),
32-
[
33-
'debounce_amount' => $this->config->getDebounceMilliseconds($storeId),
34-
'minimum_characters' => $this->config->getMinimumCharacters($storeId)
35-
]
36-
);
31+
if ($this->config->getDebounceMilliseconds($storeId)) {
32+
$configuration['debounce_amount'] = $this->config->getDebounceMilliseconds($storeId);
33+
}
34+
35+
if ($this->config->getMinimumCharacters($storeId)) {
36+
$configuration['minimum_characters'] = $this->config->getMinimumCharacters($storeId);
37+
}
3738
}
3839
}

0 commit comments

Comments
 (0)