Skip to content
Snippets Groups Projects
Commit 97934fed authored by matograine's avatar matograine
Browse files

remove checksum display on business cards

  * reason : checksum is not displayed on most clients.
    Displaying it here with short PK leads to user confusion.

  * comment useful code for checksum display
parent 362a4fc4
No related branches found
No related tags found
No related merge requests found
...@@ -334,6 +334,8 @@ ...@@ -334,6 +334,8 @@
// Write short pubkey centered on QRcode // Write short pubkey centered on QRcode
ctx.font = INFOS_FONT; ctx.font = INFOS_FONT;
short_pubkey = pubkey.substring(0,4) + "" + pubkey.substring(pubkey.length - 8, pubkey.length-4); short_pubkey = pubkey.substring(0,4) + "" + pubkey.substring(pubkey.length - 8, pubkey.length-4);
/***** don't show checksum until main client (cesium) displays it
colon_cksum = pubkey.substring(pubkey.length - 4, pubkey.length); colon_cksum = pubkey.substring(pubkey.length - 4, pubkey.length);
// measure text length // measure text length
let len_pk_ck = ctx.measureText(short_pubkey + colon_cksum).width; let len_pk_ck = ctx.measureText(short_pubkey + colon_cksum).width;
...@@ -349,7 +351,13 @@ ...@@ -349,7 +351,13 @@
ctx.fillStyle = CKSUM_COLOR; ctx.fillStyle = CKSUM_COLOR;
ctx.font = "italic " + INFOS_FONT; ctx.font = "italic " + INFOS_FONT;
ctx.fillText (colon_cksum, xPosCksum , yPosPubkey); ctx.fillText (colon_cksum, xPosCksum , yPosPubkey);
ctx.restore(); ctx.restore();*/
// to be removed once Cesium (or another widely used client) displays ck.
yPosPubkey = parseInt(yPosQr + QR_WIDTH_AND_HEIGHT + MARGIN_CANVAS / 2);
xPosPubkey = parseInt(xPosQr + QR_WIDTH_AND_HEIGHT / 2);
ctx.textAlign = "center";
ctx.fillText (short_pubkey, xPosPubkey , yPosPubkey);
} }
// image // image
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment