Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions apps/mail/components/ui/nav-main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export function NavMain({ items }: NavMainProps) {
);

const onSubmit = async (data: LabelType) => {
toast.promise(createLabel(data), {
toast.promise(createLabel(data).then((res) => { refetch(); return res; }), {
loading: 'Creating label...',
success: 'Label created successfully',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

toast.promise has a key finally, your promise doesn't even need to be called in the first argument

error: 'Failed to create label',
Expand Down Expand Up @@ -253,7 +253,6 @@ export function NavMain({ items }: NavMainProps) {
</Button>
}
onSubmit={onSubmit}
onSuccess={refetch}
/>
) : activeAccount?.providerId === 'microsoft' ? null : null}
</div>
Expand Down