@@ -723,27 +723,27 @@ protected override void Initialize()
723723
724724 Verify . AreEqual ( _initializationState , InitializationState . IsInitializing ) ;
725725
726- if ( _process == null )
727- {
728- var privateNetworkEnabled = ! Dispatcher . CheckAccess ( )
729- ? Dispatcher . Invoke ( ( ) => IsPrivateNetworkClientServerCapabilityEnabled )
730- : IsPrivateNetworkClientServerCapabilityEnabled ;
731- var enterpriseId = ! Dispatcher . CheckAccess ( )
732- ? Dispatcher . Invoke ( ( ) => EnterpriseId )
733- : EnterpriseId ;
734-
735- _process = new WebViewControlProcess ( new WebViewControlProcessOptions
736- {
737- PrivateNetworkClientServerCapability = privateNetworkEnabled
738- ? WebViewControlProcessCapabilityState . Enabled
739- : WebViewControlProcessCapabilityState . Disabled ,
740- EnterpriseId = enterpriseId
741- } ) ;
742- }
743-
744726 Dispatcher . InvokeAsync (
745727 async ( ) =>
746728 {
729+ if ( _process == null )
730+ {
731+ var privateNetworkEnabled = ! Dispatcher . CheckAccess ( )
732+ ? Dispatcher . Invoke ( ( ) => IsPrivateNetworkClientServerCapabilityEnabled )
733+ : IsPrivateNetworkClientServerCapabilityEnabled ;
734+ var enterpriseId = ! Dispatcher . CheckAccess ( )
735+ ? Dispatcher . Invoke ( ( ) => EnterpriseId )
736+ : EnterpriseId ;
737+
738+ _process = new WebViewControlProcess ( new WebViewControlProcessOptions
739+ {
740+ PrivateNetworkClientServerCapability = privateNetworkEnabled
741+ ? WebViewControlProcessCapabilityState . Enabled
742+ : WebViewControlProcessCapabilityState . Disabled ,
743+ EnterpriseId = enterpriseId
744+ } ) ;
745+ }
746+
747747 Verify . IsNotNull ( _process ) ;
748748
749749 if ( _webViewControl == null )
0 commit comments