From 98986201e6079887e466a83d5b17697bfe7e1f33 Mon Sep 17 00:00:00 2001 From: nishantka Date: Wed, 11 Sep 2024 22:34:08 +0530 Subject: [PATCH] using await instead of then --- libs/blocks/global-navigation/global-navigation.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/libs/blocks/global-navigation/global-navigation.js b/libs/blocks/global-navigation/global-navigation.js index 3d5f186be2..c8022e46cf 100644 --- a/libs/blocks/global-navigation/global-navigation.js +++ b/libs/blocks/global-navigation/global-navigation.js @@ -624,13 +624,11 @@ class Gnav { // Exposing UNAV config for consumers CONFIG.universalNav.universalNavConfig = getConfiguration(); - window.UniversalNav(CONFIG.universalNav.universalNavConfig) - .then(() => { - this.decorateAppPrompt({ getAnchorState: () => window.UniversalNav.getComponent?.('app-switcher') }); - isDesktop.addEventListener('change', () => { - window.UniversalNav.reload(CONFIG.universalNav.universalNavConfig); - }); - }); + await window.UniversalNav(CONFIG.universalNav.universalNavConfig); + this.decorateAppPrompt({ getAnchorState: () => window.UniversalNav.getComponent?.('app-switcher') }); + isDesktop.addEventListener('change', () => { + window.UniversalNav.reload(CONFIG.universalNav.universalNavConfig); + }); }; decorateAppPrompt = async ({ getAnchorState } = {}) => {