@@ -1604,6 +1604,7 @@ private void OnEnterAddGateway(object sender, RoutedEventArgs e)
16041604 {
16051605 _editingGatewayId = null ;
16061606 _userIntent = UserIntent . AddingGateway ;
1607+ ClearAddGatewaySshFields ( ) ;
16071608 // Direct is default — make sure the selector is on Direct.
16081609 // Pre-fill the most common local gateway URL.
16091610 DirectUrlBox . Text = "ws://127.0.0.1:18789" ;
@@ -1619,6 +1620,7 @@ private void OnEnterAddGatewayDirect(object sender, RoutedEventArgs e)
16191620 {
16201621 _editingGatewayId = null ;
16211622 _userIntent = UserIntent . AddingGateway ;
1623+ ClearAddGatewaySshFields ( ) ;
16221624 ShowAddPane ( "direct" ) ;
16231625 AddDirectItem . IsSelected = true ;
16241626 RefreshFromSnapshot ( _lastSnapshot ) ;
@@ -1628,6 +1630,7 @@ private void OnEnterAddGatewaySetupCode(object sender, RoutedEventArgs e)
16281630 {
16291631 _editingGatewayId = null ;
16301632 _userIntent = UserIntent . AddingGateway ;
1633+ ClearAddGatewaySshFields ( ) ;
16311634 ShowAddPane ( "setup" ) ;
16321635 AddSetupCodeItem . IsSelected = true ;
16331636 RefreshFromSnapshot ( _lastSnapshot ) ;
@@ -1648,6 +1651,7 @@ private void OnAddBack(object sender, RoutedEventArgs e)
16481651 AddResultText . Text = "" ;
16491652 AddSetupCodeBox . Text = "" ;
16501653 AddSetupCodePreviewPanel . Visibility = Visibility . Collapsed ;
1654+ ClearAddGatewaySshFields ( ) ;
16511655 AddScanStatusText . Text = LocalizationHelper . GetString ( "ConnectionPage_PressScan" ) ;
16521656 AddScanProgressBar . Visibility = Visibility . Collapsed ;
16531657 AddScanResultsPanel . Children . Clear ( ) ;
@@ -1681,6 +1685,16 @@ private void ShowAddPane(string tag)
16811685 UpdateRemoteSetupAdvice ( ) ;
16821686 }
16831687
1688+ private void ClearAddGatewaySshFields ( )
1689+ {
1690+ AddSshExpander . IsExpanded = false ;
1691+ AddSshUserBox . Text = "" ;
1692+ AddSshHostBox . Text = "" ;
1693+ AddSshServerPortBox . Text = "" ;
1694+ AddSshRemotePortBox . Text = "" ;
1695+ AddSshLocalPortBox . Text = "" ;
1696+ }
1697+
16841698 private void OnRemoteHelpClick ( object sender , RoutedEventArgs e )
16851699 {
16861700 AddRemoteHelpTip . IsOpen = ! AddRemoteHelpTip . IsOpen ;
0 commit comments