From 55ca7dcce1acba1440f22c20d1e1b4611aebd73d Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Fri, 30 Dec 2022 12:19:45 -0600 Subject: Update threads to use design system --- src/state/models/post-thread-view.ts | 41 +----------------------------------- 1 file changed, 1 insertion(+), 40 deletions(-) (limited to 'src/state/models/post-thread-view.ts') diff --git a/src/state/models/post-thread-view.ts b/src/state/models/post-thread-view.ts index f0f0d5ef3..f8065bb20 100644 --- a/src/state/models/post-thread-view.ts +++ b/src/state/models/post-thread-view.ts @@ -16,18 +16,6 @@ function* reactKeyGenerator(): Generator { } } -interface ReplyingTo { - author: { - handle: string - displayName?: string - avatar?: string - } - text: string -} -interface OriginalRecord { - text: string -} - function isThreadViewPost( v: GetPostThread.ThreadViewPost | GetPostThread.NotFoundPost | UnknownPost, ): v is GetPostThread.ThreadViewPost { @@ -51,9 +39,6 @@ export class PostThreadViewPostModel { parent?: PostThreadViewPostModel | GetPostThread.NotFoundPost replies?: (PostThreadViewPostModel | GetPostThread.NotFoundPost)[] - // added data - replyingTo?: ReplyingTo - constructor( public rootStore: RootStoreModel, reactKey: string, @@ -70,7 +55,6 @@ export class PostThreadViewPostModel { v: GetPostThread.ThreadViewPost, includeParent = true, includeChildren = true, - isFirstChild = true, ) { // parents if (includeParent && v.parent) { @@ -89,25 +73,9 @@ export class PostThreadViewPostModel { this.parent = v.parent } } - if ( - !includeParent && - v.parent && - isThreadViewPost(v.parent) && - !isFirstChild - ) { - this.replyingTo = { - author: { - handle: v.parent.post.author.handle, - displayName: v.parent.post.author.displayName, - avatar: v.parent.post.author.avatar, - }, - text: (v.parent.record as OriginalRecord).text, - } - } // replies if (includeChildren && v.replies) { const replies = [] - let isChildFirstChild = true for (const item of v.replies) { if (isThreadViewPost(item)) { const itemModel = new PostThreadViewPostModel( @@ -117,15 +85,8 @@ export class PostThreadViewPostModel { ) itemModel._depth = this._depth + 1 if (item.replies) { - itemModel.assignTreeModels( - keyGen, - item, - false, - true, - isChildFirstChild, - ) + itemModel.assignTreeModels(keyGen, item, false, true) } - isChildFirstChild = false replies.push(itemModel) } else if (isNotFoundPost(item)) { replies.push(item) -- cgit 1.4.1