]> Nutra Git (v2) - gamesguru/feather.git/commitdiff
trezor: close trezor suite on failure to acquire
authortobtoht <tob@featherwallet.org>
Tue, 2 Jan 2024 13:53:39 +0000 (14:53 +0100)
committertobtoht <tob@featherwallet.org>
Tue, 2 Jan 2024 13:53:39 +0000 (14:53 +0100)
src/WindowManager.cpp

index 31e7ca3e9711d8e2cedc704a4e39bfddf3c74992..6cdf92ab029703a468bd67e7ec01a3a3fc12ccc7 100644 (file)
@@ -270,7 +270,12 @@ void WindowManager::onWalletOpened(Wallet *wallet) {
             errMsg = QString("%1\n\nAttempted to clean wallet cache. Please restart Feather.").arg(errMsg);
             this->handleWalletError({nullptr, Utils::ERROR, "Unable to open wallet", errMsg});
         } else {
-            this->handleWalletError({nullptr, Utils::ERROR, "Unable to open wallet", errMsg});
+            QStringList helpItems = {};
+            if (errMsg == "Failed to acquire device") {
+                helpItems.append("Try closing Trezor suite");
+            }
+
+            this->handleWalletError({nullptr, Utils::ERROR, "Unable to open wallet", errMsg, helpItems});
         }
         return;
     }
@@ -340,7 +345,7 @@ void WindowManager::tryCreateWallet(Seed seed, const QString &path, const QStrin
     }
 
     if (seed.mnemonic.isEmpty()) {
-        this->handleWalletError({nullptr, Utils::ERROR, "Failed to create wallet", "Mnemonic seed is emopty"});
+        this->handleWalletError({nullptr, Utils::ERROR, "Failed to create wallet", "Mnemonic seed is empty"});
         return;
     }
 
@@ -455,6 +460,9 @@ void WindowManager::onWalletCreated(Wallet *wallet) {
             link = "https://wiki.trezor.io/Udev_rules";
 #endif
         }
+        else if (error.contains("Failed to acquire device")) {
+            helpItems = {"Try closing Trezor suite"};
+        }
         if (error.contains("SW_CLIENT_NOT_SUPPORTED")) {
             helpItems = {"Upgrade your Ledger device firmware to the latest version using Ledger Live.\n"
                          "Then upgrade the Monero app for the Ledger device to the latest version."};