@@ -10,7 +10,7 @@ const AppRootAttrsBlacklist = ['_nghost', 'ng-version'];
1010const MockRootAttrsBlacklist = [ ] ;
1111
1212registerPlugin ( 'render' , FlashPrevention , flashPreventionPlugin ) ;
13- registerPlugin ( 'router' , FlashPrevention , async ur => [ { route : ur } ] ) ;
13+ registerPlugin ( 'router' , FlashPrevention , async ( ur ) => [ { route : ur } ] ) ;
1414
1515interface FlashPreventionPluginOptions {
1616 appRootSelector ?: string ;
@@ -25,7 +25,7 @@ export function getFlashPreventionPlugin({
2525 appLoadedClass,
2626 appRootAttributesBlacklist,
2727 mockAttributesBlacklist,
28- displayType
28+ displayType,
2929} : FlashPreventionPluginOptions = { } ) {
3030 if ( appRootSelector ) {
3131 AppRootSelector = appRootSelector ;
@@ -88,7 +88,11 @@ async function addBitsToHead(html) {
8888 document.body.classList.add('${ LoadedClass } ');
8989 const tempAppRoot = document.querySelector('${ AppRootSelector } -scully');
9090 tempAppRoot.parentNode.removeChild(tempAppRoot);
91- window.removeEventListener('AngularReady', scullyDiscountFlashPreventionContentScript);
91+ window.removeEventListener('AngularReady', scullyDiscountFlashPreventionContentScript);
92+ window.dispatchEvent(new Event('FlashPreventionSwitchDone', {
93+ bubbles: true,
94+ cancelable: false
95+ }))
9296 }
9397</script>
9498<style type="text/css">
@@ -107,7 +111,7 @@ function pushItemsToArray(src, dest) {
107111 if ( src . length && ! Array . isArray ( src ) ) {
108112 src = [ src ] ;
109113 }
110- src . forEach ( item => dest . push ( item ) ) ;
114+ src . forEach ( ( item ) => dest . push ( item ) ) ;
111115 }
112116}
113117
0 commit comments