git ssb

9+

cel / ssb-viewer



Commit 9f0354990d92384a0a2d222469e672f428402bfd

Fix render crash on wierd mentions

Anders Rune Jensen committed on 12/18/2017, 9:13:19 PM
Parent: 2dcdef60a24ea6a888eee961f4c90e89cc87ca94

Files changed

render.jschanged
render.jsView
@@ -32,9 +32,9 @@
3232 return this.opts.base + "channel/" + href.slice(1);
3333 case "%":
3434 return this.opts.msg_base + encodeURIComponent(href);
3535 case "@":
36- href = this.opts.mentions[href.substr(1)] || href;
36 + href = (this.opts.mentions && this.opts.mentions[href.substr(1)]) || href;
3737 return this.opts.feed_base + encodeURIComponent(href);
3838 case "&":
3939 return this.opts.blob_base + encodeURIComponent(href);
4040 }
@@ -57,11 +57,10 @@
5757 };
5858
5959 function renderEmoji(emoji) {
6060 var opts = this.renderer.opts;
61- var mentions = opts.mentions;
62- var url = mentions[emoji]
63- ? opts.blob_base + encodeURIComponent(mentions[emoji])
61 + var url = opts.mentions[emoji]
62 + ? opts.blob_base + encodeURIComponent(opts.mentions[emoji])
6463 : emoji in emojis && opts.emoji_base + escape(emoji) + '.png';
6564 return url
6665 ? h('img.ssb-emoji',
6766 { src: url,

Built with git-ssb-web