File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -83,22 +83,23 @@ export const ProposalCard = ({
8383 ) ?. offsetFromStartTs ?. offset ?? new BN ( 0 ) ,
8484 ) )
8585
86+ const proposalUri = useMemo ( ( ) => proposal ?. uri , [ proposal ] )
8687 const {
8788 error : descError ,
8889 loading : descLoading ,
8990 result : desc ,
9091 } = useAsync ( async ( ) => {
91- if ( proposal && proposal . uri ) {
92+ if ( proposalUri ) {
9293 // Force HTTPS for security - convert any HTTP URLs to HTTPS
93- const secureUri = proposal . uri . replace ( / ^ h t t p : \/ \/ / , 'https://' )
94+ const secureUri = proposalUri . replace ( / ^ h t t p : \/ \/ / , 'https://' )
9495 const { data } = await axios . get ( secureUri )
9596 const htmlContent = markdownParser . render ( data )
9697 const firstParagraphMatch = htmlContent . match ( / < p > ( .* ?) < \/ p > / i)
9798 return firstParagraphMatch
9899 ? firstParagraphMatch [ 0 ] . replace ( / < [ ^ > ] + > / g, '' )
99100 : t ( 'gov.proposals.noDescription' )
100101 }
101- } , [ proposal ] )
102+ } , [ proposalUri ] )
102103
103104 const votingResults = useMemo ( ( ) => {
104105 const totalVotes : BN = [ ...( proposal ?. choices || [ ] ) ] . reduce (
You can’t perform that action at this time.
0 commit comments