Commit c1a1dc7a8dc3f88bd242e418cb5715798385f4e4
Use multiline ternary operation
Christian Bundy committed on 11/14/2018, 9:33:53 PMParent: b7cfda1f1985477fd342a7651020c340ee0325f1
Files changed
message/html/render/about.js | changed |
message/html/render/about.js | ||
---|---|---|
@@ -41,18 +41,18 @@ | ||
41 | 41 … | // TODO : build better normalizers |
42 | 42 … | if (image && ref.isBlob(image.link)) image = image.link |
43 | 43 … | about = about || link |
44 | 44 … | |
45 | - // Safety check - are the incoming things actually text | |
46 | - if(typeof name != 'string') | |
47 | - name = undefined | |
48 | - if(typeof description != 'string') | |
49 | - description = undefined | |
50 | - | |
51 | 45 … | const metaData = [ |
52 | - name ? h('div', [ h('strong', 'Name: '), name ]) : undefined, | |
53 | - description ? h('div', [ h('strong', 'Description: '), description ]) : undefined, | |
54 | - image ? h('img', { src: api.blob.sync.url(image), style: { 'margin-top': '.5rem' } }) : undefined | |
46 … | + typeof name === 'string' | |
47 … | + ? h('div', [ h('strong', 'Name: '), name ]) | |
48 … | + : undefined, | |
49 … | + typeof description === 'string' | |
50 … | + ? h('div', [ h('strong', 'Description: '), description ]) | |
51 … | + : undefined, | |
52 … | + typeof image === 'string' | |
53 … | + ? h('img', { src: api.blob.sync.url(image), style: { 'margin-top': '.5rem' } }) | |
54 … | + : undefined | |
55 | 55 … | ] |
56 | 56 … | |
57 | 57 … | if (!ref.isFeed(about)) { |
58 | 58 … | return [ |
Built with git-ssb-web