Skip to content

Commit 0d024fb

Browse files
committed
Fix post reply in topic
1 parent accc6ad commit 0d024fb

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Modules/Sources/TopicFeature/TopicFeature.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,10 @@ public struct TopicFeature: Reducer, Sendable {
200200

201201
case .contextPostMenu(let action):
202202
switch action {
203-
case .reply(let authorId, let authorName):
203+
case .reply(let postId, let authorName):
204204
state.writeForm = WriteFormFeature.State(formFor: .post(
205205
topicId: state.topicId,
206-
content: .simple("[SNAPBACK]\(authorId)[/SNAPBACK] [B]\(authorName)[/B], ", [])
206+
content: .simple("[SNAPBACK]\(postId)[/SNAPBACK] [B]\(authorName)[/B], ", [])
207207
))
208208
return .none
209209
}

Modules/Sources/TopicFeature/TopicScreen.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ public struct TopicScreen: View {
247247
}
248248

249249
if store.isUserAuthorized {
250-
OptionsPostMenu()
250+
OptionsPostMenu(post.id)
251251
}
252252
}
253253
}
@@ -288,12 +288,12 @@ public struct TopicScreen: View {
288288
// MARK: - Options Post Menu
289289

290290
@ViewBuilder
291-
private func OptionsPostMenu() -> some View {
291+
private func OptionsPostMenu(_ postId: Int) -> some View {
292292
Menu {
293293
if let topic = store.topic, topic.canPost {
294294
Section {
295295
ContextButton(text: "Reply", symbol: .arrowTurnUpRight, bundle: .module) {
296-
store.send(.contextPostMenu(.reply(topic.authorId, topic.authorName)))
296+
store.send(.contextPostMenu(.reply(postId, topic.authorName)))
297297
}
298298
}
299299
}

0 commit comments

Comments
 (0)