Fix build assets from console (#7300)

This commit is contained in:
Yuriy Bakhtin 2024-11-08 10:23:15 +01:00 committed by GitHub
parent 405d262d9f
commit abcfdea847
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -34,8 +34,10 @@ class LiveAsset extends AssetBundle
{
parent::init();
Yii::$app->view->registerJsConfig('live.poll', [
'nonce' => Security::getNonce(),
]);
if (!Yii::$app->request->isConsoleRequest) {
Yii::$app->view->registerJsConfig('live.poll', [
'nonce' => Security::getNonce(),
]);
}
}
}