diff options
Diffstat (limited to 'app/assets/javascripts/helpers/startup_css_helper.js')
-rw-r--r-- | app/assets/javascripts/helpers/startup_css_helper.js | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/app/assets/javascripts/helpers/startup_css_helper.js b/app/assets/javascripts/helpers/startup_css_helper.js index 8e25e1421c0..d41a6209898 100644 --- a/app/assets/javascripts/helpers/startup_css_helper.js +++ b/app/assets/javascripts/helpers/startup_css_helper.js @@ -20,19 +20,9 @@ const handleStartupEvents = () => { } }; -/* Wait for.... The methods can be used: - - with a callback (preferred), - waitFor(action) - - - with then (discouraged), - await waitFor().then(action); - - - with await, - await waitFor; - action(); --*/ +/* For `waitForCSSLoaded` methods, see docs.gitlab.com/ee/development/fe_guide/performance.html#important-considerations */ export const waitForCSSLoaded = (action = () => {}) => { - if (!gon.features.startupCss || allLinksLoaded()) { + if (!gon?.features?.startupCss || allLinksLoaded()) { return new Promise(resolve => { action(); resolve(); |