Skip to content

Commit

Permalink
fix: don't use GulpReload on PJAX requets
Browse files Browse the repository at this point in the history
  • Loading branch information
winternet-studio committed Apr 7, 2024
1 parent 1db5083 commit 6fc445a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/modules/GulpReload.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ class GulpReload extends \yii\base\Module {

public function init() {
parent::init();
$app =& Yii::$app;

if (Yii::$app->request->isConsoleRequest) {
if ($app->request->isConsoleRequest || $app->request->get('_pjax')) {
return;
}

// Delay attaching event handler to the view component after it is fully configured (idea from yii\debug\Module)
$app =& Yii::$app;
$app->on(\yii\base\Application::EVENT_BEFORE_REQUEST, function () use ($app) {
$app->getView()->on(\yii\web\View::EVENT_END_BODY, [$this, 'clientJs']);
});
Expand Down

0 comments on commit 6fc445a

Please sign in to comment.