From ef94986909e8bef52e50e5a384e263d3d86f9a3d Mon Sep 17 00:00:00 2001 From: marino <102478601+kemuru@users.noreply.github.com> Date: Fri, 8 Sep 2023 13:54:58 +0200 Subject: [PATCH] chore(web): remove new lines on message --- web/netlify/functions/update-settings.ts | 2 +- .../Settings/SendMeNotifications/FormNotifs/index.tsx | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/web/netlify/functions/update-settings.ts b/web/netlify/functions/update-settings.ts index 7ab0ca0da..0e9f86119 100644 --- a/web/netlify/functions/update-settings.ts +++ b/web/netlify/functions/update-settings.ts @@ -7,7 +7,7 @@ const supabase = createClient(SUPABASE_URL!, SUPABASE_KEY!); export const uploadSettingsToSupabase = async function (event: any, context: any) { try { const { message, address, signature } = JSON.parse(event.body); - const email = message.replace(/\n|\r/g, "").split("Email:").pop().split("Nonce:")[0].trim(); + const email = message.split("Email:").pop().split(",Nonce:")[0].trim(); const nonce = message.split("Nonce:").pop().trim(); console.log( ":rocket: ~ file: index.tsx:42 ~ handleSupabase ~ email, signature, address, nonce:", diff --git a/web/src/layout/Header/navbar/Menu/Settings/SendMeNotifications/FormNotifs/index.tsx b/web/src/layout/Header/navbar/Menu/Settings/SendMeNotifications/FormNotifs/index.tsx index 206c3311f..012c2d96c 100644 --- a/web/src/layout/Header/navbar/Menu/Settings/SendMeNotifications/FormNotifs/index.tsx +++ b/web/src/layout/Header/navbar/Menu/Settings/SendMeNotifications/FormNotifs/index.tsx @@ -45,13 +45,7 @@ const FormNotifs: React.FC = () => { const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); const nonce = new Date().getTime(); - const message = ` - Email: - ${emailInput} - - Nonce: - ${nonce} -`; + const message = `Email:${emailInput},Nonce:${nonce}`; const signature = await walletClient?.signMessage({ account: address, message: message, @@ -64,7 +58,6 @@ const FormNotifs: React.FC = () => { await uploadSettingsToSupabase(data); }; - return ( {OPTIONS.map(({ label }, index) => (