-
Notifications
You must be signed in to change notification settings - Fork 16
Fix Submit Button Loading State and Prevent Double Submissions #246
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
Conversation
…for Bug when pressing the buy or sell button repeatedly #161
WalkthroughThis update introduces internal logic changes to key management and session handling, and refactors the order-taking screen to a stateful widget. The order-taking UI now manages submission state, provides improved user feedback, and prevents duplicate actions. No public API signatures were altered, but internal behaviors and widget structure were updated. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant TakeOrderScreen
participant MessageStream
participant SessionNotifier
User->>TakeOrderScreen: Press "Take Order" button
TakeOrderScreen->>TakeOrderScreen: Set _isSubmitting = true
alt Order has amount range
TakeOrderScreen->>User: Show amount entry dialog
User-->>TakeOrderScreen: Enter amount or cancel
alt User cancels
TakeOrderScreen->>TakeOrderScreen: Set _isSubmitting = false
else User enters amount
TakeOrderScreen->>SessionNotifier: takeBuyOrder/takeSellOrder(amount)
end
else No amount range
TakeOrderScreen->>SessionNotifier: takeBuyOrder/takeSellOrder(parsed amount)
end
MessageStream-->>TakeOrderScreen: Receive action (e.g., "cantDo")
TakeOrderScreen->>TakeOrderScreen: If _isSubmitting, set _isSubmitting = false
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
💤 Files with no reviewable changes (1)
🧰 Additional context used📓 Path-based instructions (4)lib/shared/**/*.dart📄 CodeRabbit Inference Engine (CLAUDE.md)
Files:
lib/**/*.dart📄 CodeRabbit Inference Engine (CLAUDE.md)
Files:
**/*.dart📄 CodeRabbit Inference Engine (CLAUDE.md)
Files:
lib/features/*/{screens,providers,notifiers,widgets}/**/*.dart📄 CodeRabbit Inference Engine (CLAUDE.md)
Files:
🧠 Learnings (9)📓 Common learnings📚 Learning: in the orderstate refactor, public keys should be accessed via `tradestate.peer?.publickey` from the...Applied to files:
📚 Learning: in abstractmostronotifier, state updates occur for all messages regardless of timestamp to hydrate t...Applied to files:
📚 Learning: applies to lib/core/mostro_fsm.dart : order state transitions must be managed by `core/mostro_fsm.da...Applied to files:
📚 Learning: mostroservice methods like takebuyorder() and takesellorder() return future and trigger side e...Applied to files:
📚 Learning: applies to lib/features/*/{screens,providers,notifiers,widgets}/**/*.dart : feature-based organizati...Applied to files:
📚 Learning: use riverpod for all state management...Applied to files:
📚 Learning: applies to lib/core/app_routes.dart : navigation must be configured using gorouter in `core/app_rout...Applied to files:
📚 Learning: applies to lib/**/*.dart : use `s.of(context).yourkey` for all user-facing strings...Applied to files:
🔇 Additional comments (1)
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Catrya
left a comment
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.
tACK
Issues Addressed
#160: Bug with key management creating a new user
#161: Bug when pressing the buy or sell button repeatedly
Changes Made
Submit Button Loading State
Key Features
Technical Implementation
Impact
Summary by CodeRabbit
New Features
Bug Fixes
Improvements