Skip to content

Commit

Permalink
Display the memo on the transaction details page
Browse files Browse the repository at this point in the history
  • Loading branch information
Flavien committed Dec 4, 2015
1 parent 2c7d607 commit 35c9522
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
11 changes: 11 additions & 0 deletions www/js/controllers/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ module.controller("TransactionInfoController", function ($scope, $rootScope, $ro
mutationHash: result.mutationHash.toHex(),
transactionHash: result.transactionHash.toHex(),
namespace: encodingService.decodeString(result.mutation.namespace),
memo: getMemo(result.mutation.metadata),
acc_records: [],
data_records: [],
endpoint: endpoint,
Expand Down Expand Up @@ -83,6 +84,16 @@ module.controller("TransactionInfoController", function ($scope, $rootScope, $ro
});
}

function getMemo(metadata) {
try {
var decodedMetadata = JSON.parse(encodingService.decodeString(metadata));
return decodedMetadata.memo;
}
catch (e) {
return null;
}
}

for (var key in endpointManager.endpoints) {
loadEndpoint(key);
}
Expand Down
4 changes: 4 additions & 0 deletions www/views/transaction.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ <h4>General</h4>
<th>Namespace</th>
<td>{{ transaction.namespace }}</td>
</tr>
<tr ng-show="transaction.memo">
<th>Memo</th>
<td><code>{{ transaction.memo }}</code></td>
</tr>
</table>

<div ng-show="transaction.acc_records.length > 0">
Expand Down

0 comments on commit 35c9522

Please sign in to comment.