Skip to content

Commit 699ab31

Browse files
authored
fix: remove double toast and decrease time from 30s to 15s (#1934)
1 parent a3068ee commit 699ab31

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

apps/mail/components/create/create-email.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import { useDraft } from '@/hooks/use-drafts';
1414
import { useEffect, useState } from 'react';
1515

1616
import type { Attachment } from '@/types';
17-
import { m } from '@/paraglide/messages';
1817
import { useQueryState } from 'nuqs';
1918
import { X } from '../icons/icons';
2019
import posthog from 'posthog-js';
@@ -122,7 +121,6 @@ export function CreateEmail({
122121
posthog.capture('Create Email Sent');
123122
}
124123

125-
toast.success(m['pages.createEmail.emailSentSuccessfully']());
126124
handleUndoSend(result, settings);
127125
};
128126

apps/mail/components/mail/reply-composer.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,7 @@ export default function ReplyCompose({ messageId }: ReplyComposeProps) {
210210
// Reset states
211211
setMode(null);
212212
await refetch();
213-
toast.success(m['pages.createEmail.emailSent']());
214-
setTimeout(() => {
215-
handleUndoSend(result, settings);
216-
}, 500);
213+
handleUndoSend(result, settings);
217214
} catch (error) {
218215
console.error('Error sending email:', error);
219216
toast.error(m['pages.createEmail.failedToSendEmail']());

apps/mail/hooks/use-undo-send.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const useUndoSend = () => {
1313
if (isSendResult(result) && settings?.settings?.undoSendEnabled) {
1414
const { messageId, sendAt } = result;
1515

16-
const timeRemaining = sendAt ? sendAt - Date.now() : 30_000;
16+
const timeRemaining = sendAt ? sendAt - Date.now() : 15_000;
1717

1818
if (timeRemaining > 5_000) {
1919
toast.success('Email scheduled', {
@@ -28,7 +28,7 @@ export const useUndoSend = () => {
2828
}
2929
},
3030
},
31-
duration: timeRemaining,
31+
duration: 15_000,
3232
});
3333
}
3434
}

0 commit comments

Comments
 (0)