fix splash not using onetime-password when changing peer tab

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages 2023-08-17 18:28:55 +08:00
parent d7f0acd96d
commit d2c84c5fc2

View File

@ -197,17 +197,18 @@ class ServerModel with ChangeNotifier {
_approveMode = approveMode;
update = true;
}
final oldPwdText = _serverPasswd.text;
if (_serverPasswd.text != temporaryPassword &&
temporaryPassword.isNotEmpty) {
_serverPasswd.text = temporaryPassword;
}
var stopped = option2bool(
"stop-service", await bind.mainGetOption(key: "stop-service"));
final oldPwdText = _serverPasswd.text;
if (stopped ||
verificationMethod == kUsePermanentPassword ||
_approveMode == 'click') {
_serverPasswd.text = '-';
} else {
if (_serverPasswd.text != temporaryPassword &&
temporaryPassword.isNotEmpty) {
_serverPasswd.text = temporaryPassword;
}
}
if (oldPwdText != _serverPasswd.text) {
update = true;