@@ -4,7 +4,11 @@ import {iconCollapsed16, iconExpanded16} from '../../ui-constants'
44
55const CertificatesInTxPart = ( { getters} ) => {
66 const { certsInTx, votesInTx} = getters
7- const amountOfCertsAndVotesInTx = ( ) => certsInTx . length + votesInTx . length
7+ let amountOfVotesInTx = 0
8+ if ( votesInTx ) {
9+ amountOfVotesInTx = JSON . parse ( votesInTx ) . length
10+ }
11+ const amountOfCertsAndVotesInTx = ( ) => certsInTx . length + amountOfVotesInTx
812 const getAllInOne = ( ) => {
913 const resultArray = [ ]
1014 for ( const certInTx of certsInTx ) {
@@ -13,11 +17,12 @@ const CertificatesInTxPart = ({getters}) => {
1317 const certJsonObject = JSON . parse ( certInTx )
1418 resultArray . push ( [ cleanCertName , certJsonObject ] )
1519 }
16- for ( const voteInTx of votesInTx ) {
17- const votePartWithName = voteInTx . split ( '\n' ) [ 1 ]
18- const cleanVoteName = votePartWithName . split ( '"' ) [ 1 ]
19- const voteJsonObject = JSON . parse ( voteInTx )
20- resultArray . push ( [ cleanVoteName , voteJsonObject ] )
20+ if ( votesInTx ) {
21+ const voteJsonObjects = JSON . parse ( votesInTx )
22+ console . log ( 'voteJsonObjects' , voteJsonObjects )
23+ for ( const voteJsonObject of voteJsonObjects ) {
24+ resultArray . push ( [ 'Votes' , voteJsonObject ] )
25+ }
2126 }
2227 return resultArray
2328 }
@@ -28,7 +33,7 @@ const CertificatesInTxPart = ({getters}) => {
2833
2934 return (
3035 < ExpandablePanel
31- title = { `Certificates in Tx ( ${ amountOfCertsAndVotesInTx ( ) } )` }
36+ title = { `Certificates and Votes in Tx ( ${ amountOfCertsAndVotesInTx ( ) } )` }
3237 generalPanelStyles = { mainPanelStyles }
3338 titleStyles = { mainPanelTitleStyles }
3439 collapsedIcon = { iconCollapsed16 }
0 commit comments