fix wrong display of custom clients when approval mode is not set (#9779)

when approve-mode is not set, the approve mode option shows as
password, it's `both` approve mode in rust, so only ui is wrong.

Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
21pages 2024-10-30 11:29:39 +08:00 committed by GitHub
parent 415d2c5c60
commit ce7867c1c0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1029,7 +1029,9 @@ class _SafetyState extends State<_Safety> with AutomaticKeepAliveClientMixin {
translate('Accept sessions via both'), translate('Accept sessions via both'),
]; ];
var modeInitialKey = model.approveMode; var modeInitialKey = model.approveMode;
if (!modeKeys.contains(modeInitialKey)) modeInitialKey = ''; if (!modeKeys.contains(modeInitialKey)) {
modeInitialKey = defaultOptionApproveMode;
}
final usePassword = model.approveMode != 'click'; final usePassword = model.approveMode != 'click';
final isApproveModeFixed = isOptionFixed(kOptionApproveMode); final isApproveModeFixed = isOptionFixed(kOptionApproveMode);