@@ -15,7 +15,6 @@ declare global {
1515
1616const loadScript = ( hsId : string ) => {
1717 // Detect the provider is already loaded and return early
18- console . debug ( { loadScript : window . HubSpotConversations } )
1918 if ( window . HubSpotConversations ) {
2019 return false
2120 }
@@ -56,10 +55,6 @@ const load = ({
5655 window . hsConversationsOnReady = [
5756 ( ) => {
5857 window . HubSpotConversations . widget . load ( )
59- console . debug ( {
60- hsConversationsOnReady : 'ready' ,
61- widgetStatus : window . HubSpotConversations . widget . status ( )
62- } )
6358 }
6459 ]
6560 const loaded = loadScript ( providerKey )
@@ -68,38 +63,24 @@ const load = ({
6863
6964 waitForLoad (
7065 ( ) => {
71- console . debug ( {
72- waitForLoad : {
73- HubSpotConversations : window . HubSpotConversations ,
74- widget : window . HubSpotConversations ?. widget
75- }
76- } )
7766 return Boolean (
7867 window . HubSpotConversations &&
7968 window . HubSpotConversations . widget &&
8069 window . HubSpotConversations . widget . status ( ) . loaded
8170 )
8271 } ,
83- // Allow intercom to complete loading before removing fake widget
72+ // Allow hubspot to complete loading before removing fake widget
8473 ( ) => {
85- console . debug ( {
86- loadComplete : window . HubSpotConversations ,
87- widgetStatus : window . HubSpotConversations . widget . status ( )
88- } )
8974 window . HubSpotConversations . widget . open ( )
9075 setState ( 'complete' )
9176 onReady ( )
92- console . debug ( {
93- widgetStatusAfterTimeout : window . HubSpotConversations . widget . status ( )
94- } )
9577 }
9678 )
9779 }
9880 return loaded
9981}
10082
10183const open = ( ) : unknown => {
102- console . debug ( { open : 'called' } )
10384 window . HubSpotConversations &&
10485 window . HubSpotConversations . widget &&
10586 ! window . HubSpotConversations . widget . status ( ) . loaded &&
0 commit comments