File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
Plugin/Frontend/Magento/Theme/Controller/Result Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change 1414use Magento \Framework \App \ResponseInterface ;
1515use Magento \Framework \View \Result \Layout ;
1616use Magento \Store \Model \ScopeInterface ;
17+ use Magefan \RocketJavaScript \Model \Config ;
1718
1819class JsFooterPlugin
1920{
20-
21- private const XML_PATH_RJ_DEFERRED_ENABLED = 'mfrocketjavascript/deferred_javascript/enabled ' ;
22-
2321 /**
2422 * @var ScopeConfigInterface
2523 */
@@ -48,12 +46,12 @@ public function aroundAfterRenderResult(
4846 Layout $ result ,
4947 ResponseInterface $ httpResponse
5048 ) {
51- $ jsRjOptimization = $ this ->scopeConfig ->isSetFlag (self ::XML_PATH_RJ_DEFERRED_ENABLED , ScopeInterface::SCOPE_STORE )
52- && $ this ->scopeConfig ->isSetFlag ('mfrocketjavascript/general/enabled ' , ScopeInterface::SCOPE_STORE );
53- if ($ jsRjOptimization ) {
54- return $ result ;
55- }
49+ $ jsRjOptimization =
50+ $ this ->scopeConfig ->isSetFlag (Config::XML_PATH_DEFERRED_ENABLED , ScopeInterface::SCOPE_STORE ) &&
51+ $ this ->scopeConfig ->isSetFlag (Config::XML_PATH_EXTENSION_ENABLED , ScopeInterface::SCOPE_STORE );
5652
57- return $ proceed ($ argumentSubject , $ result , $ httpResponse );
53+ return $ jsRjOptimization
54+ ? $ result
55+ : $ proceed ($ argumentSubject , $ result , $ httpResponse );
5856 }
5957}
You can’t perform that action at this time.
0 commit comments