@@ -13,6 +13,12 @@ type CCMember = {
1313 newExpirationEpoch ?: number ;
1414} ;
1515
16+ function isArrayOfStrings ( value : unknown ) : value is string [ ] {
17+ return (
18+ Array . isArray ( value ) && value . every ( ( item ) => typeof item === "string" )
19+ ) ;
20+ }
21+
1622export const GovernanceActionNewCommitteeDetailsTabContent = ( {
1723 details,
1824} : Pick < ProposalData , "details" > ) => {
@@ -38,6 +44,10 @@ export const GovernanceActionNewCommitteeDetailsTabContent = ({
3844 newExpirationEpoch : member . newExpirationEpoch ,
3945 } ) ) ;
4046
47+ const membersToBeRemoved = isArrayOfStrings ( details ?. membersToBeRemoved )
48+ ? details . membersToBeRemoved
49+ : [ ] ;
50+
4151 return (
4252 < Box >
4353 { membersToBeAdded . length > 0 && (
@@ -78,7 +88,7 @@ export const GovernanceActionNewCommitteeDetailsTabContent = ({
7888 ) ) }
7989 </ Box >
8090 ) }
81- { ( details ?. membersToBeRemoved as string [ ] ) . length > 0 && (
91+ { membersToBeRemoved . length > 0 && (
8292 < Box mb = "32px" >
8393 < Typography
8494 sx = { {
@@ -93,8 +103,8 @@ export const GovernanceActionNewCommitteeDetailsTabContent = ({
93103 >
94104 { t ( "govActions.membersToBeRemoved" ) }
95105 </ Typography >
96- { ( details ?. membersToBeRemoved as string [ ] ) . map ( ( hash ) => (
97- < Box display = "flex" flexDirection = "row" >
106+ { membersToBeRemoved . map ( ( hash ) => (
107+ < Box display = "flex" flexDirection = "row" key = { hash } >
98108 < Typography
99109 sx = { {
100110 fontSize : 16 ,
0 commit comments