summary refs log tree commit diff
diff options
context:
space:
mode:
authorIntegral <integral@member.fsf.org>2024-06-17 11:00:45 +0800
committerIntegral <integral@member.fsf.org>2024-06-17 11:00:56 +0800
commit992468d6c172231847b9a28379181601b0e4f5e4 (patch)
tree4516f10b1de820201ab4debe0f4c2ab7e974b2e4
parentUpdate src/UserSettingsPage.cpp (diff)
downloadnheko-992468d6c172231847b9a28379181601b0e4f5e4.tar.xz
Place repeatedPassword after first check & remove unnecessary empty check
-rw-r--r--src/UserSettingsPage.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/UserSettingsPage.cpp b/src/UserSettingsPage.cpp
index 4dfdc96a..f50bc3c0 100644
--- a/src/UserSettingsPage.cpp
+++ b/src/UserSettingsPage.cpp
@@ -2127,6 +2127,11 @@ UserSettingsModel::exportSessionKeys()
     if (!ok)
         return;
 
+    if (password.isEmpty()) {
+        QMessageBox::warning(nullptr, tr("Error"), tr("The password cannot be empty"));
+        return;
+    }
+
     auto repeatedPassword = QInputDialog::getText(nullptr,
                                                   tr("Repeat File Password"),
                                                   tr("Repeat the passphrase:"),
@@ -2136,16 +2141,6 @@ UserSettingsModel::exportSessionKeys()
     if (!ok)
         return;
 
-    if (password.isEmpty()) {
-        QMessageBox::warning(nullptr, tr("Error"), tr("The password cannot be empty"));
-        return;
-    }
-
-    if (repeatedPassword.isEmpty()) {
-        QMessageBox::warning(nullptr, tr("Error"), tr("Please repeat the password"));
-        return;
-    }
-
     if (password != repeatedPassword) {
         QMessageBox::warning(nullptr, tr("Error"), tr("Passwords don't match"));
         return;