Skip to content
Open
Changes from all 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
5 changes: 3 additions & 2 deletions apps/mail/components/ui/nav-main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@ export function NavMain({ items }: NavMainProps) {
);

const onSubmit = async (data: LabelType) => {
toast.promise(createLabel(data), {
toast.promise(createLabel(data).finally(()=>{
refetch();
}), {
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 +255,6 @@ export function NavMain({ items }: NavMainProps) {
</Button>
}
onSubmit={onSubmit}
onSuccess={refetch}
/>
) : activeAccount?.providerId === 'microsoft' ? null : null}
</div>
Expand Down
Loading