allow set empty permanent password to delete it

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages 2022-11-21 16:37:15 +08:00
parent 65a0276c58
commit 16165dae27
2 changed files with 2 additions and 2 deletions

View File

@ -486,7 +486,7 @@ void setPasswordDialog() async {
errMsg1 = "";
});
final pass = p0.text.trim();
if (pass.length < 6) {
if (pass.length < 6 && pass.isNotEmpty) {
setState(() {
errMsg0 = translate("Too short, at least 6 characters.");
});

View File

@ -958,7 +958,7 @@ class PasswordArea: Reactor.Component {
if (!res) return;
var p0 = (res.password || "").trim();
var p1 = (res.confirmation || "").trim();
if (p0.length < 6) {
if (p0.length < 6 && p0.length != 0) {
return translate("Too short, at least 6 characters.");
}
if (p0 != p1) {