Skip to content

Commit ad9ef7f

Browse files
committed
Fixed some typos
1 parent 93ea188 commit ad9ef7f

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

app/(app)/settings/_client.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,9 @@ const Settings = ({ profile }: { profile: User }) => {
416416
</h2>
417417
<Button
418418
className="w-[250px]"
419-
disabled={!(newEmail || loading)}
419+
disabled={
420+
!newEmail || newEmail === profile.email || loading
421+
}
420422
onClick={handleNewEmailUpdate}
421423
>
422424
{loading && (

utils/emailToken.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ export const storeTokenInDb = async (
3535
export const sendVerificationEmail = async (email: string, token: string) => {
3636
const verificationLink = `${process.env.NEXT_PUBLIC_BACKEND_URL}/verify-email?token=${token}`;
3737
const subject = "Verify Your Email Address";
38-
3938
const htmlMessage = `
4039
<!DOCTYPE html>
4140
<html lang="en">
@@ -104,7 +103,12 @@ export const sendVerificationEmail = async (email: string, token: string) => {
104103
</html>
105104
`;
106105

107-
return sendEmail({ recipient: email, htmlMessage, subject });
106+
try {
107+
return sendEmail({ recipient: email, htmlMessage, subject });
108+
} catch (error) {
109+
console.error("Error sending verification email:", error);
110+
throw new Error("Failed to send verification email");
111+
}
108112
};
109113

110114
export const getTokenFromDb = async (token: string, userId: string) => {

0 commit comments

Comments
 (0)