From efae6ae70f5626f17ed0799f7eb57566d2d52547 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Tue, 2 Jan 2024 14:53:39 +0100 Subject: [PATCH] trezor: close trezor suite on failure to acquire --- src/WindowManager.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/WindowManager.cpp b/src/WindowManager.cpp index 31e7ca3..6cdf92a 100644 --- a/src/WindowManager.cpp +++ b/src/WindowManager.cpp @@ -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."};