fix: the issue of compose new mail while on draft folder#1240
fix: the issue of compose new mail while on draft folder#1240MrgSub merged 2 commits intoMail-0:stagingfrom
Conversation
WalkthroughThe change updates the email compose dialog logic to reset the draft ID by setting it to null whenever the dialog is closed. This ensures that any association with a previous draft is cleared, preventing unintended persistence of draft state when composing a new email. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant ComposeDialog
participant StateManager
User->>ComposeDialog: Close compose dialog
ComposeDialog->>StateManager: set isComposeOpen = false
ComposeDialog->>StateManager: setDraftId(null)
StateManager-->>ComposeDialog: Draft state cleared
Assessment against linked issues
Assessment against linked issues: Out-of-scope changesNo out-of-scope changes found. Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches
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 (
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/mail/components/create/create-email.tsx(1 hunks)
🔇 Additional comments (1)
apps/mail/components/create/create-email.tsx (1)
158-158: The fix correctly addresses the stated bug.While the implementation could be more targeted, this change does solve the core issue described in the PR objectives. Clearing the draft ID ensures that when users compose new emails after viewing drafts, they get a clean compose window instead of prefilled draft content.
Description
currently if you try to compose new mail while staying in drafts folder (try after opening a draft mail), you will get the drafted mail prefilled .
fix: #1238
Type of Change
Please delete options that are not relevant.
Areas Affected
Please check all that apply:
Testing Done
Describe the tests you've done:
Security Considerations
For changes involving data or authentication:
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the project's license.
Summary by CodeRabbit