@@ -72,7 +72,14 @@ public extension MessageAction {
7272 messageActions. append ( replyAction)
7373 }
7474
75- if channel. config. repliesEnabled && !message. isPartOfThread {
75+ // At the moment, this is the only way to know if we are inside a thread.
76+ // This should be optimised in the future and provide the view context.
77+ let messageController = InjectedValues [ \. utils]
78+ . channelControllerFactory
79+ . makeMessageController ( for: message. id, channelId: channel. cid)
80+ let isInsideThreadView = messageController. replies. count > 0
81+
82+ if channel. config. repliesEnabled && !message. isPartOfThread && !isInsideThreadView {
7683 let replyThread = threadReplyAction (
7784 factory: factory,
7885 for: message,
@@ -113,12 +120,6 @@ public extension MessageAction {
113120 }
114121
115122 if message. isRootOfThread {
116- let messageController = InjectedValues [ \. utils]
117- . channelControllerFactory
118- . makeMessageController ( for: message. id, channelId: channel. cid)
119- // At the moment, this is the only way to know if we are inside a thread.
120- // This should be optimised in the future and provide the view context.
121- let isInsideThreadView = messageController. replies. count > 0
122123 if isInsideThreadView {
123124 let markThreadUnreadAction = markThreadAsUnreadAction (
124125 messageController: messageController,
0 commit comments