@@ -156,21 +156,10 @@ export class ElementAdvancedOptionComponent implements OnChanges, OnInit {
156156 hidden : ( ) => {
157157 if ( ! this . connectMethod ) return true ;
158158 if ( ! gs . CONNECTION_TOKEN_REUSABLE ) return true ;
159-
160- // razor 直接显示
161159 if ( this . connectMethod . component === 'razor' ) return false ;
162160
163161 if ( this . connectMethod . component === 'tinker' ) {
164- const method = (
165- this . connectOption . appletConnectMethod ??
166- this . connectOption . virtualappConnectMethod ??
167- this . setting . graphics . applet_connection_method ??
168- ''
169- )
170- . toString ( )
171- . toLowerCase ( ) ;
172-
173- return method !== 'client' ;
162+ return this . connectOption . appletConnectMethod !== 'client' ;
174163 }
175164
176165 return true ;
@@ -212,6 +201,26 @@ export class ElementAdvancedOptionComponent implements OnChanges, OnInit {
212201
213202 this . advancedOptions = this . allOptions . filter ( i => ! i . hidden ( ) ) ;
214203 this . isShowAdvancedOption = this . advancedOptions . length > 0 ;
204+
205+ // 如果记住的 select 值已不在可选项中,回退到 web 或默认值
206+ this . advancedOptions
207+ . filter ( i => i . type === 'select' )
208+ . forEach ( i => {
209+ const options = i . options || [ ] ;
210+ const values = new Set ( options . map ( opt => opt . value ) ) ;
211+ const current = this . connectOption [ i . field ] ;
212+
213+ if ( ! values . has ( current ) ) {
214+ let fallback : any = 'web' ;
215+
216+ if ( ! values . has ( fallback ) ) {
217+ fallback = i . value !== undefined ? i . value : options [ 0 ] ? options [ 0 ] . value : undefined ;
218+ }
219+ if ( fallback !== undefined ) {
220+ this . connectOption [ i . field ] = fallback ;
221+ }
222+ }
223+ } ) ;
215224 }
216225
217226 onChange ( ) {
0 commit comments