From f5c0a9b1257d3bb132e01fe73396ed8979db4d6d Mon Sep 17 00:00:00 2001 From: Dan Janosik Date: Fri, 28 Jul 2017 11:17:55 -0400 Subject: [PATCH] fix template errors for unconfirmed transactions --- views/transaction.pug | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/views/transaction.pug b/views/transaction.pug index a73f4f2..88ecb00 100644 --- a/views/transaction.pug +++ b/views/transaction.pug @@ -14,8 +14,10 @@ block content a(href="/") strong #{host} span :#{port} - li(class="breadcrumb-item") - a(href=("/block/" + result.getrawtransaction.blockhash)) Block #{result.getblock.height} + + if (result.getrawtransaction.blockhash) + li(class="breadcrumb-item") + a(href=("/block/" + result.getrawtransaction.blockhash)) Block #{result.getblock.height} li(class="breadcrumb-item active") Transaction h1(class="h2") Transaction @@ -61,7 +63,8 @@ block content th(class="table-active properties-header") Included in Block td a(href=("/block/" + result.getrawtransaction.blockhash)) #{result.getrawtransaction.blockhash} - span(class="text-muted") (#{result.getblock.height}) + if (result.getblock && result.getblock.height) + span(class="text-muted") (#{result.getblock.height}) tr th(class="table-active properties-header") Timestamp @@ -107,8 +110,8 @@ block content tr th(class="table-active properties-header") Confirmations td - if (result.getrawtransaction.confirmations == 0) - strong(class="text-danger") #{result.getrawtransaction.confirmations} (Unconfirmed!) + if (!result.getrawtransaction.confirmations || result.getrawtransaction.confirmations == 0) + strong(class="text-danger") 0 (unconfirmed) else if (result.getrawtransaction.confirmations < 6) strong(class="text-warning") #{result.getrawtransaction.confirmations} else @@ -268,4 +271,4 @@ block content //pre #{JSON.stringify(result.txInputs, null, 4)} - \ No newline at end of file +