diff --git a/src/components/posts/PostComponent.svelte b/src/components/posts/PostComponent.svelte index e95ebd7..3eb078c 100644 --- a/src/components/posts/PostComponent.svelte +++ b/src/components/posts/PostComponent.svelte @@ -123,6 +123,13 @@ {/if} + {#if post.hasBeenEdited} +
+ Edited – show original text: +

{post.originalText}

+
+ {/if} + {#if post.embed && shouldRenderEmbed(post.embed)} {/if} @@ -242,6 +249,20 @@ cursor: default; } + .original-text { + margin-top: 20px; + margin-bottom: 20px; + } + + .original-text summary { + font-size: 11pt; + color: #e06000; + } + + .original-body { + font-size: 11pt; + } + .missing-replies-info { font-size: 11pt; color: darkred; diff --git a/src/models/posts.js b/src/models/posts.js index 517dfad..9e78bec 100644 --- a/src/models/posts.js +++ b/src/models/posts.js @@ -441,6 +441,16 @@ export class Post extends BasePost { return !!(this.data.threadgate && this.data.threadgate.record.allow !== undefined && this.data.threadgate.record.allow.length == 0); } + /** @returns {boolean} */ + get hasBeenEdited() { + return !!(this.record.originalText); + } + + /** @returns {string | undefined} */ + get originalText() { + return this.record.originalText; + } + /** @returns {number} */ get repostCount() { return castToInt(this.data.repostCount);