-
Notifications
You must be signed in to change notification settings - Fork 983
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#20035] feat: import missing key pair by scanning QR code
- Loading branch information
1 parent
9de8613
commit 6932af2
Showing
10 changed files
with
141 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/status_im/contexts/settings/wallet/keypairs_and_accounts/scan_qr/view.cljs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
(ns status-im.contexts.settings.wallet.keypairs-and-accounts.scan-qr.view | ||
(:require | ||
[status-im.common.scan-qr-code.view :as scan-qr-code] | ||
[status-im.contexts.communities.events] | ||
[status-im.contexts.syncing.utils :as sync-utils] | ||
[utils.debounce :as debounce] | ||
[utils.i18n :as i18n] | ||
[utils.re-frame :as rf])) | ||
|
||
(def invalid-qr-toast | ||
{:type :negative | ||
:theme :dark | ||
:text (i18n/label :t/invalid-qr)}) | ||
|
||
(defn show-invalid-qr-toast | ||
[] | ||
(debounce/debounce-and-dispatch | ||
[:toasts/upsert invalid-qr-toast] | ||
300)) | ||
|
||
(defn on-qr-code-scanned | ||
[scanned-text] | ||
(if (sync-utils/valid-connection-string? scanned-text) | ||
(rf/dispatch [:wallet/connection-string-for-key-pair-import scanned-text]) | ||
(show-invalid-qr-toast))) | ||
|
||
(defn view | ||
[] | ||
[scan-qr-code/view | ||
{:title (i18n/label :t/scan-key-pairs-qr-code) | ||
:subtitle (i18n/label :t/find-it-in-setting) | ||
:share-button? false | ||
:on-success-scan on-qr-code-scanned}]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters