-
Notifications
You must be signed in to change notification settings - Fork 47
feat: add long-press reply functionality for reply items #127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -134,6 +134,12 @@ struct FeedDetailPage: StateView, KeyboardReadable, InstanceIdentifiable { | |||
| dismiss() | ||||
| } | ||||
| } | ||||
| .onChange(of: state.shouldFocusReply) { shouldFocus in | ||||
| if shouldFocus { | ||||
| replyIsFocused = true | ||||
| store.appState.feedDetailStates[instanceId]?.shouldFocusReply = false | ||||
|
||||
| store.appState.feedDetailStates[instanceId]?.shouldFocusReply = false |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -117,6 +117,9 @@ func feedDetailStateReducer(_ states: FeedDetailStates, _ action: Action) -> (Fe | |||||||||||||||||
| } else { | ||||||||||||||||||
| Toast.show("感谢发送失败") | ||||||||||||||||||
| } | ||||||||||||||||||
| case let action as FeedDetailActions.ReplyToUser: | ||||||||||||||||||
| state.replyContent = "@\(action.userName) " | ||||||||||||||||||
| state.shouldFocusReply = true | ||||||||||||||||||
|
Comment on lines
+121
to
+122
|
||||||||||||||||||
| state.replyContent = "@\(action.userName) " | |
| state.shouldFocusReply = true | |
| if AccountState.isSelf(userName: action.userName) { | |
| Toast.show("不能回复自己") | |
| } else { | |
| state.replyContent = "@\(action.userName) " | |
| state.shouldFocusReply = true | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This action should validate that the user is logged in before allowing the reply flow, similar to other actions in this file. Consider converting this to an AwaitAction with an execute method that checks AccountState.hasSignIn() and shows a login prompt if needed, following the pattern established in ThankReply (line 338-377), ReplyTopic (line 205-236), and other similar actions.