Merge pull request #79 from lbryio/transaction-date-placeholder

On Wallet page, show placeholder text for dates on pending transactions
This commit is contained in:
alexliebowitz 2016-11-15 01:09:27 -05:00 committed by GitHub
commit 3471184828

View file

@ -179,7 +179,7 @@ var TransactionList = React.createClass({
{ {
transactionItems.push({ transactionItems.push({
id: txid, id: txid,
date: new Date(parseInt(tx["timestamp"]) * 1000), date: tx["timestamp"] ? (new Date(parseInt(tx["timestamp"]) * 1000)) : null,
amount: condensedTransactions[txid] amount: condensedTransactions[txid]
}); });
delete condensedTransactions[txid]; delete condensedTransactions[txid];
@ -198,8 +198,8 @@ var TransactionList = React.createClass({
rows.push( rows.push(
<tr key={item.id}> <tr key={item.id}>
<td>{ (item.amount > 0 ? '+' : '' ) + item.amount }</td> <td>{ (item.amount > 0 ? '+' : '' ) + item.amount }</td>
<td>{ item.date.toLocaleDateString() }</td> <td>{ item.date ? item.date.toLocaleDateString() : <span className="empty">(Transaction pending)</span> }</td>
<td>{ item.date.toLocaleTimeString() }</td> <td>{ item.date ? item.date.toLocaleTimeString() : <span className="empty">(Transaction pending)</span> }</td>
<td> <td>
<a className="button-text" href={"https://explorer.lbry.io/tx/"+item.id} target="_blank">{item.id.substr(0, 7)}</a> <a className="button-text" href={"https://explorer.lbry.io/tx/"+item.id} target="_blank">{item.id.substr(0, 7)}</a>
</td> </td>