#4 - To add a way to export and import mail sessions, i added two buttons in the header. one for export, one for import. export was pretty simple. to import, we read the file, parse the JSON, and then validate it. validateSession function checks if the object has address and key and that theyre both non-empty strings.
now i wanted two different states:
- if the file is valid -> show a warning “this will overwrite your current session, u sure?”
- if the file is invalid -> just show an error with the Alert component
used AlertDialog from cossui for both. the valid one has a Cancel and Continue button, and the invalid one just shows the error in a red Alert and an OK button to close
also had to make sure the dialog state is controlled with open and onOpenChange because otherwise it wouldnt close properly after importing.
next up i wanna work on the inbox and make it actually look good when theres no emails
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.