refactor to avoid unnecessary emojify computations (#143)
This commit is contained in:
parent
0e54e15f72
commit
8fb00a961c
|
@ -77,10 +77,10 @@
|
||||||
shown && 'shown'
|
shown && 'shown'
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
massagedContent: (originalStatus, $autoplayGifs) => {
|
content: (originalStatus) => originalStatus.content,
|
||||||
let content = originalStatus.content
|
emojis: (originalStatus) => originalStatus.emojis,
|
||||||
|
massagedContent: (content, emojis, $autoplayGifs) => {
|
||||||
content = emojifyText(content, originalStatus.emojis, $autoplayGifs)
|
content = emojifyText(content, emojis, $autoplayGifs)
|
||||||
|
|
||||||
// GNU Social and Pleroma don't add <p> tags
|
// GNU Social and Pleroma don't add <p> tags
|
||||||
if (!content.startsWith('<p>')) {
|
if (!content.startsWith('<p>')) {
|
||||||
|
|
|
@ -61,9 +61,10 @@
|
||||||
store: () => store,
|
store: () => store,
|
||||||
computed: {
|
computed: {
|
||||||
spoilerText: (originalStatus) => originalStatus.spoiler_text,
|
spoilerText: (originalStatus) => originalStatus.spoiler_text,
|
||||||
massagedSpoilerText: (spoilerText, originalStatus, $autoplayGifs) => {
|
emojis: (originalStatus) => originalStatus.emojis,
|
||||||
|
massagedSpoilerText: (spoilerText, emojis, $autoplayGifs) => {
|
||||||
spoilerText = escapeHtml(spoilerText)
|
spoilerText = escapeHtml(spoilerText)
|
||||||
return emojifyText(spoilerText, originalStatus.emojis, $autoplayGifs)
|
return emojifyText(spoilerText, emojis, $autoplayGifs)
|
||||||
},
|
},
|
||||||
delegateKey: (uuid) => `spoiler-${uuid}`
|
delegateKey: (uuid) => `spoiler-${uuid}`
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue