git ssb

16+

Dominic / patchbay



Commit c1a1dc7a8dc3f88bd242e418cb5715798385f4e4

Use multiline ternary operation

Christian Bundy committed on 11/14/2018, 9:33:53 PM
Parent: b7cfda1f1985477fd342a7651020c340ee0325f1

Files changed

message/html/render/about.jschanged
message/html/render/about.jsView
@@ -41,18 +41,18 @@
4141 // TODO : build better normalizers
4242 if (image && ref.isBlob(image.link)) image = image.link
4343 about = about || link
4444
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-
5145 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
5555 ]
5656
5757 if (!ref.isFeed(about)) {
5858 return [

Built with git-ssb-web