diff --git a/routes/_components/status/Status.html b/routes/_components/status/Status.html
index af79266..8bfaba6 100644
--- a/routes/_components/status/Status.html
+++ b/routes/_components/status/Status.html
@@ -23,9 +23,9 @@
:originalStatus :uuid :spoilerShown
on:recalculateHeight />
{{/if}}
- {{#if !spoilerText || spoilerShown}}
+ {{#if showContent || contentPreloaded}}
+ :originalStatus :uuid shown="{{showContent}}"/>
{{/if}}
{{#if originalStatus.media_attachments && originalStatus.media_attachments.length}}
INPUT_TAGS.has(node.localName)
@@ -127,6 +128,13 @@
// the whole is clickable in this case
registerClickDelegate(delegateKey, (e) => this.onClickOrKeydown(e))
}
+ if (!this.get('showContent')) {
+ scheduleIdleTask(() => {
+ // Perf optimization: lazily load the StatusContent when the user is idle so that
+ // it's fast when they click the "show more" button
+ this.set({contentPreloaded: true})
+ })
+ }
},
ondestroy() {
let delegateKey = this.get('delegateKey')
@@ -214,7 +222,8 @@
timelineType !== 'search' && 'status-in-timeline',
isStatusInOwnThread && 'status-in-own-thread'
)
- }
+ },
+ showContent: (spoilerText, spoilerShown) => !spoilerText || spoilerShown
}
}
\ No newline at end of file
diff --git a/routes/_components/status/StatusContent.html b/routes/_components/status/StatusContent.html
index 34a3140..15c12b1 100644
--- a/routes/_components/status/StatusContent.html
+++ b/routes/_components/status/StatusContent.html
@@ -1,7 +1,4 @@
-