Issue fixing - #1016 - "Verify on device" asks to plug in an air-gapped cold card (#1157)

* Added tests/bitcoin to gitignore

* fix for issue #1016, displaying a warning before using coldcard over usb and offering a link to coinkite to learn about the address explorer

Co-authored-by: Kim Neunert <k9ert@gmx.de>
This commit is contained in:
Manolis 2021-05-18 14:14:10 +02:00 committed by GitHub
parent 6cc9252517
commit 27bab09aaf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 1 deletions

1
.gitignore vendored
View file

@ -30,4 +30,3 @@ btcd-conn.json
tests/bitcoin
tests/bitcoin.binary
tests/bitcoin.compile

View file

@ -9,6 +9,7 @@
{# === wallet specific stuff ==== #}
{% include 'includes/hwi/components/wallet.jinja' %}
<div id="hwi_progress" class="hidden" style="width: 270px;">
<h1 id="hwi_progress_title">Processing...</h1>
<div class="flex-center" id="hwi_progress_text">Keep your wallet connected.</div><br>
@ -23,6 +24,16 @@
<br>
</div>
<div class="flex-column hidden" id="coldcard_warning">
<p> Do you really want to use your Coldcard over USB (no airgap)? </p>
<div class="flex-center">
<button onclick="coldCardNotice()" class="btn flex-center"> Yes, I am living on the edge! </button>
</div> <br>
<div class="flex-center">
<button onclick = "goToCoinkite()" class="btn flex-center"> No, I'll use the address explorer on the Coldcard. Get me to the coinkite site for more info. </button>
</div>
</div>
<script type="text/javascript">
let hwiURL = '/hwi/api/';
if (
@ -53,7 +64,22 @@
}
}
var coldcardUsb = 0;
function coldCardNotice(){
coldcardUsb = 1;
cancelOverlay();
}
function goToCoinkite(){
parent.open("https://blog.coinkite.com/address-explorer/");
cancelOverlay();
}
async function enumerate(deviceTypes=null, devicePath=null, passphrase=''){
// special handling of coldcard
if (deviceTypes == 'coldcard' && coldcardUsb == 0) {
document.getElementById("page_overlay_popup_content").appendChild(document.getElementById("coldcard_warning"));
}
// detect device
if (devicePath == null) {
showHWIProgress("Detecting...", "Plug in your device");