Commit f1ffefef120bd92dc224753582b37184ead261cd
channel: fix missing tagged with channel posts
Matt McKegg committed on 12/13/2017, 7:43:47 AMParent: 3c9974aebea46a6e072284cfdd3ef4d581f054ee
Files changed
modules/page/html/render/channel.js | changed |
modules/page/html/render/channel.js | ||
---|---|---|
@@ -57,14 +57,20 @@ | ||
57 | 57 … | if (msg.value.content.type === 'vote') return false |
58 | 58 … | if (api.channel.sync.normalize(msg.value.content.channel) === channel) return true |
59 | 59 … | if (Array.isArray(msg.value.content.mentions)) { |
60 | 60 … | if (msg.value.content.mentions.some(mention => { |
61 | - return mention && api.channel.sync.normalize(mention.link) === `#${channel}` | |
61 … | + return mention && getNormalized(mention.link) === `#${channel}` | |
62 | 62 … | })) { |
63 | 63 … | return 'channel-mention' |
64 | 64 … | } |
65 | 65 … | } |
66 | 66 … | } |
67 … | + | |
68 … | + function getNormalized (link) { | |
69 … | + if (typeof link === 'string' && link.startsWith('#')) { | |
70 … | + return `#${api.channel.sync.normalize(link.slice(1))}` | |
71 … | + } | |
72 … | + } | |
67 | 73 … | }) |
68 | 74 … | |
69 | 75 … | function subscribe (id) { |
70 | 76 … | // confirm |
Built with git-ssb-web