rename temporary password to one-time password

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2022-11-21 14:06:32 +08:00
parent 50be5c0f14
commit 6f390759f3
29 changed files with 88 additions and 84 deletions

View File

@@ -2,6 +2,7 @@ import 'dart:async';
import 'dart:io';
import 'dart:convert';
import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/material.dart' hide MenuItem;
import 'package:flutter/services.dart';
import 'package:flutter_hbb/common.dart';
@@ -202,10 +203,11 @@ class _DesktopHomePageState extends State<DesktopHomePage>
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
translate("Password"),
AutoSizeText(
translate("One-time Password"),
style: TextStyle(
fontSize: 14, color: textColor?.withOpacity(0.5)),
maxLines: 1,
),
Row(
children: [

View File

@@ -586,7 +586,7 @@ class _SafetyState extends State<_Safety> with AutomaticKeepAliveClientMixin {
kUseBothPasswords,
];
List<String> passwordValues = [
translate('Use temporary password'),
translate('Use one-time password'),
translate('Use permanent password'),
translate('Use both passwords'),
];
@@ -665,7 +665,7 @@ class _SafetyState extends State<_Safety> with AutomaticKeepAliveClientMixin {
Offstage(
offstage: !usePassword,
child: _SubLabeledWidget(
'Temporary Password Length',
'One-time password length',
Row(
children: [
...lengthRadios,

View File

@@ -35,7 +35,8 @@ class ServerModel with ChangeNotifier {
late String _emptyIdShow;
late final IDTextEditingController _serverId;
final _serverPasswd = TextEditingController(text: "");
final _serverPasswd =
TextEditingController(text: translate("Generating ..."));
final tabController = DesktopTabController(tabType: DesktopTabType.cm);
@@ -170,7 +171,8 @@ class ServerModel with ChangeNotifier {
update = true;
}
final oldPwdText = _serverPasswd.text;
if (_serverPasswd.text != temporaryPassword) {
if (_serverPasswd.text != temporaryPassword &&
temporaryPassword.isNotEmpty) {
_serverPasswd.text = temporaryPassword;
}
if (verificationMethod == kUsePermanentPassword ||