@@ -72,7 +72,14 @@ public extension MessageAction {
72
72
messageActions. append ( replyAction)
73
73
}
74
74
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 {
76
83
let replyThread = threadReplyAction (
77
84
factory: factory,
78
85
for: message,
@@ -113,12 +120,6 @@ public extension MessageAction {
113
120
}
114
121
115
122
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
122
123
if isInsideThreadView {
123
124
let markThreadUnreadAction = markThreadAsUnreadAction (
124
125
messageController: messageController,
0 commit comments