From 8b57b40f5ddff47ca0d68cbc0cb7ce238971f1b4 Mon Sep 17 00:00:00 2001 From: Karthik Bhat Date: Tue, 14 Sep 2021 17:43:26 +0530 Subject: [PATCH] Fix module toggle console error (#21071) --- .../boost/app/assets/src/js/utils/generate-critical-css.ts | 2 +- .../plugins/boost/changelog/fix-module-toggle-console-error | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 projects/plugins/boost/changelog/fix-module-toggle-console-error diff --git a/projects/plugins/boost/app/assets/src/js/utils/generate-critical-css.ts b/projects/plugins/boost/app/assets/src/js/utils/generate-critical-css.ts index 852290a994855..f4c9cc14054a2 100644 --- a/projects/plugins/boost/app/assets/src/js/utils/generate-critical-css.ts +++ b/projects/plugins/boost/app/assets/src/js/utils/generate-critical-css.ts @@ -41,7 +41,7 @@ let hasGenerateRun = false; * runs if the module is enabled again. */ modules.subscribe( modulesState => { - if ( ! modulesState[ 'critical-css' ].enabled ) { + if ( ! modulesState[ 'critical-css' ] || ! modulesState[ 'critical-css' ].enabled ) { hasGenerateRun = false; } } ); diff --git a/projects/plugins/boost/changelog/fix-module-toggle-console-error b/projects/plugins/boost/changelog/fix-module-toggle-console-error new file mode 100644 index 0000000000000..9b86c791a73f1 --- /dev/null +++ b/projects/plugins/boost/changelog/fix-module-toggle-console-error @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Fix console error on critical-css module subscription status