Skip to content

Commit 43855aa

Browse files
Requirejs not definded on swagger page fix
1 parent 42c8d82 commit 43855aa

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Model/Observer.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,29 @@ class Observer implements ObserverInterface
1818
private $registry;
1919
private $storeManager;
2020
private $pageConfig;
21+
private $request;
2122

2223
public function __construct(
2324
ConfigHelper $configHelper,
2425
Registry $registry,
2526
StoreManagerInterface $storeManager,
26-
PageConfig $pageConfig
27+
PageConfig $pageConfig,
28+
\Magento\Framework\App\Request\Http $http
2729
) {
2830
$this->config = $configHelper;
2931
$this->registry = $registry;
3032
$this->storeManager = $storeManager;
3133
$this->pageConfig = $pageConfig;
34+
$this->request = $http;
3235
}
3336

3437
public function execute(\Magento\Framework\Event\Observer $observer)
3538
{
39+
$actionName = $this->request->getFullActionName();
40+
if ($actionName === 'swagger_index_index') {
41+
return $this;
42+
}
43+
3644
if ($this->config->isEnabledFrontEnd()) {
3745
if ($this->config->getApplicationID() && $this->config->getAPIKey()) {
3846
if ($this->config->isAutoCompleteEnabled() || $this->config->isInstantEnabled()) {

0 commit comments

Comments
 (0)