Skip to content

Commit

Permalink
using await instead of then
Browse files Browse the repository at this point in the history
  • Loading branch information
nishantka committed Sep 11, 2024
1 parent 8cba27e commit 9898620
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions libs/blocks/global-navigation/global-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 } = {}) => {
Expand Down

0 comments on commit 9898620

Please sign in to comment.