diff --git a/src/status_im/contexts/wallet/account/tabs/about/view.cljs b/src/status_im/contexts/wallet/account/tabs/about/view.cljs index b5c3adb09c0f..57140a724794 100644 --- a/src/status_im/contexts/wallet/account/tabs/about/view.cljs +++ b/src/status_im/contexts/wallet/account/tabs/about/view.cljs @@ -7,6 +7,7 @@ [status-im.contexts.profile.utils :as profile.utils] [status-im.contexts.shell.constants :as constants] [status-im.contexts.wallet.account.tabs.about.style :as style] + [status-im.contexts.wallet.add-account.create-account.utils :as create-account.utils] [status-im.contexts.wallet.common.utils :as utils] [utils.i18n :as i18n] [utils.re-frame :as rf])) @@ -103,5 +104,5 @@ :stored (if keypair-keycard? :on-keycard :on-device) :profile-picture (profile.utils/photo profile) :customization-color customization-color - :derivation-path path + :derivation-path (create-account.utils/normalize-path path) :keypair-name keypair-name}])])) diff --git a/src/status_im/contexts/wallet/add_account/create_account/utils.cljs b/src/status_im/contexts/wallet/add_account/create_account/utils.cljs index ad77728ae0a5..d9746a0432ca 100644 --- a/src/status_im/contexts/wallet/add_account/create_account/utils.cljs +++ b/src/status_im/contexts/wallet/add_account/create_account/utils.cljs @@ -1,5 +1,6 @@ (ns status-im.contexts.wallet.add-account.create-account.utils - (:require [status-im.constants :as constants])) + (:require [clojure.string :as string] + [status-im.constants :as constants])) (defn first-derived-account [account-data keypair-type] @@ -56,3 +57,13 @@ :derived-from address :last-used-derivation-index 0 :accounts [account-config]})) + +(defn legacy-path? + [s] + (re-matches #"m/\d+" s)) + +(defn normalize-path + [path] + (if (legacy-path? path) + (str constants/path-wallet-root "/" (last (string/split path "/"))) + path)) diff --git a/src/status_im/contexts/wallet/add_account/create_account/view.cljs b/src/status_im/contexts/wallet/add_account/create_account/view.cljs index 8c0ab7472d72..0dc6e82155c0 100644 --- a/src/status_im/contexts/wallet/add_account/create_account/view.cljs +++ b/src/status_im/contexts/wallet/add_account/create_account/view.cljs @@ -12,6 +12,7 @@ [status-im.common.standard-authentication.core :as standard-auth] [status-im.constants :as constants] [status-im.contexts.wallet.add-account.create-account.style :as style] + [status-im.contexts.wallet.add-account.create-account.utils :as create-account.utils] [status-im.contexts.wallet.common.utils :as common.utils] [status-im.contexts.wallet.sheets.account-origin.view :as account-origin] [status-im.feature-flags :as ff] @@ -255,11 +256,12 @@ {:on-complete #(rf/dispatch [:keycard/connect-derive-address-and-add-account - {:pin % + {:pin % :derived-from-address derived-from - :key-uid key-uid - :derivation-path @derivation-path - :account-preferences preferences}])}]))) + :key-uid key-uid + :derivation-path (create-account.utils/normalize-path + @derivation-path) + :account-preferences preferences}])}]))) [derived-from])] (rn/use-effect #(rf/dispatch