diff --git a/fixtures/webstudio-cloudflare-template/app/routes/_index.tsx b/fixtures/webstudio-cloudflare-template/app/routes/_index.tsx index e8340acd13fb..7857f961298c 100644 --- a/fixtures/webstudio-cloudflare-template/app/routes/_index.tsx +++ b/fixtures/webstudio-cloudflare-template/app/routes/_index.tsx @@ -267,7 +267,10 @@ export const action = async ({ const submitTime = parseInt(formBotValue, 16); // 5 minutes - if (Math.abs(Date.now() - submitTime) > 1000 * 60 * 5) { + if ( + Number.isNaN(submitTime) || + Math.abs(Date.now() - submitTime) > 1000 * 60 * 5 + ) { throw new Error(`Form bot value invalid ${formBotValue}`); } diff --git a/fixtures/webstudio-custom-template/app/routes/[script-test]._index.tsx b/fixtures/webstudio-custom-template/app/routes/[script-test]._index.tsx index 9b348ff4a71d..2994e77d7796 100644 --- a/fixtures/webstudio-custom-template/app/routes/[script-test]._index.tsx +++ b/fixtures/webstudio-custom-template/app/routes/[script-test]._index.tsx @@ -267,7 +267,10 @@ export const action = async ({ const submitTime = parseInt(formBotValue, 16); // 5 minutes - if (Math.abs(Date.now() - submitTime) > 1000 * 60 * 5) { + if ( + Number.isNaN(submitTime) || + Math.abs(Date.now() - submitTime) > 1000 * 60 * 5 + ) { throw new Error(`Form bot value invalid ${formBotValue}`); } diff --git a/fixtures/webstudio-custom-template/app/routes/[world]._index.tsx b/fixtures/webstudio-custom-template/app/routes/[world]._index.tsx index d11a2cf51d87..309b5877df29 100644 --- a/fixtures/webstudio-custom-template/app/routes/[world]._index.tsx +++ b/fixtures/webstudio-custom-template/app/routes/[world]._index.tsx @@ -267,7 +267,10 @@ export const action = async ({ const submitTime = parseInt(formBotValue, 16); // 5 minutes - if (Math.abs(Date.now() - submitTime) > 1000 * 60 * 5) { + if ( + Number.isNaN(submitTime) || + Math.abs(Date.now() - submitTime) > 1000 * 60 * 5 + ) { throw new Error(`Form bot value invalid ${formBotValue}`); } diff --git a/fixtures/webstudio-custom-template/app/routes/_index.tsx b/fixtures/webstudio-custom-template/app/routes/_index.tsx index e8340acd13fb..7857f961298c 100644 --- a/fixtures/webstudio-custom-template/app/routes/_index.tsx +++ b/fixtures/webstudio-custom-template/app/routes/_index.tsx @@ -267,7 +267,10 @@ export const action = async ({ const submitTime = parseInt(formBotValue, 16); // 5 minutes - if (Math.abs(Date.now() - submitTime) > 1000 * 60 * 5) { + if ( + Number.isNaN(submitTime) || + Math.abs(Date.now() - submitTime) > 1000 * 60 * 5 + ) { throw new Error(`Form bot value invalid ${formBotValue}`); } diff --git a/fixtures/webstudio-remix-netlify-edge-functions/app/routes/_index.tsx b/fixtures/webstudio-remix-netlify-edge-functions/app/routes/_index.tsx index e8340acd13fb..7857f961298c 100644 --- a/fixtures/webstudio-remix-netlify-edge-functions/app/routes/_index.tsx +++ b/fixtures/webstudio-remix-netlify-edge-functions/app/routes/_index.tsx @@ -267,7 +267,10 @@ export const action = async ({ const submitTime = parseInt(formBotValue, 16); // 5 minutes - if (Math.abs(Date.now() - submitTime) > 1000 * 60 * 5) { + if ( + Number.isNaN(submitTime) || + Math.abs(Date.now() - submitTime) > 1000 * 60 * 5 + ) { throw new Error(`Form bot value invalid ${formBotValue}`); } diff --git a/fixtures/webstudio-remix-netlify-functions/app/routes/_index.tsx b/fixtures/webstudio-remix-netlify-functions/app/routes/_index.tsx index e8340acd13fb..7857f961298c 100644 --- a/fixtures/webstudio-remix-netlify-functions/app/routes/_index.tsx +++ b/fixtures/webstudio-remix-netlify-functions/app/routes/_index.tsx @@ -267,7 +267,10 @@ export const action = async ({ const submitTime = parseInt(formBotValue, 16); // 5 minutes - if (Math.abs(Date.now() - submitTime) > 1000 * 60 * 5) { + if ( + Number.isNaN(submitTime) || + Math.abs(Date.now() - submitTime) > 1000 * 60 * 5 + ) { throw new Error(`Form bot value invalid ${formBotValue}`); } diff --git a/fixtures/webstudio-remix-vercel/app/routes/[_route_with_symbols_]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[_route_with_symbols_]._index.tsx index 5fa7004c98a2..682ca81af5ee 100644 --- a/fixtures/webstudio-remix-vercel/app/routes/[_route_with_symbols_]._index.tsx +++ b/fixtures/webstudio-remix-vercel/app/routes/[_route_with_symbols_]._index.tsx @@ -267,7 +267,10 @@ export const action = async ({ const submitTime = parseInt(formBotValue, 16); // 5 minutes - if (Math.abs(Date.now() - submitTime) > 1000 * 60 * 5) { + if ( + Number.isNaN(submitTime) || + Math.abs(Date.now() - submitTime) > 1000 * 60 * 5 + ) { throw new Error(`Form bot value invalid ${formBotValue}`); } diff --git a/fixtures/webstudio-remix-vercel/app/routes/[form]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[form]._index.tsx index f574e837c1ea..769db973b8f7 100644 --- a/fixtures/webstudio-remix-vercel/app/routes/[form]._index.tsx +++ b/fixtures/webstudio-remix-vercel/app/routes/[form]._index.tsx @@ -267,7 +267,10 @@ export const action = async ({ const submitTime = parseInt(formBotValue, 16); // 5 minutes - if (Math.abs(Date.now() - submitTime) > 1000 * 60 * 5) { + if ( + Number.isNaN(submitTime) || + Math.abs(Date.now() - submitTime) > 1000 * 60 * 5 + ) { throw new Error(`Form bot value invalid ${formBotValue}`); } diff --git a/fixtures/webstudio-remix-vercel/app/routes/[heading-with-id]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[heading-with-id]._index.tsx index c4f95d45e6b0..9bd58053aa13 100644 --- a/fixtures/webstudio-remix-vercel/app/routes/[heading-with-id]._index.tsx +++ b/fixtures/webstudio-remix-vercel/app/routes/[heading-with-id]._index.tsx @@ -267,7 +267,10 @@ export const action = async ({ const submitTime = parseInt(formBotValue, 16); // 5 minutes - if (Math.abs(Date.now() - submitTime) > 1000 * 60 * 5) { + if ( + Number.isNaN(submitTime) || + Math.abs(Date.now() - submitTime) > 1000 * 60 * 5 + ) { throw new Error(`Form bot value invalid ${formBotValue}`); } diff --git a/fixtures/webstudio-remix-vercel/app/routes/[nested].[nested-page]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[nested].[nested-page]._index.tsx index 2f35feb0710d..bcd78b155c8f 100644 --- a/fixtures/webstudio-remix-vercel/app/routes/[nested].[nested-page]._index.tsx +++ b/fixtures/webstudio-remix-vercel/app/routes/[nested].[nested-page]._index.tsx @@ -267,7 +267,10 @@ export const action = async ({ const submitTime = parseInt(formBotValue, 16); // 5 minutes - if (Math.abs(Date.now() - submitTime) > 1000 * 60 * 5) { + if ( + Number.isNaN(submitTime) || + Math.abs(Date.now() - submitTime) > 1000 * 60 * 5 + ) { throw new Error(`Form bot value invalid ${formBotValue}`); } diff --git a/fixtures/webstudio-remix-vercel/app/routes/[radix]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[radix]._index.tsx index 9f78fc2381ff..7656b7fd9a2f 100644 --- a/fixtures/webstudio-remix-vercel/app/routes/[radix]._index.tsx +++ b/fixtures/webstudio-remix-vercel/app/routes/[radix]._index.tsx @@ -267,7 +267,10 @@ export const action = async ({ const submitTime = parseInt(formBotValue, 16); // 5 minutes - if (Math.abs(Date.now() - submitTime) > 1000 * 60 * 5) { + if ( + Number.isNaN(submitTime) || + Math.abs(Date.now() - submitTime) > 1000 * 60 * 5 + ) { throw new Error(`Form bot value invalid ${formBotValue}`); } diff --git a/fixtures/webstudio-remix-vercel/app/routes/[resources]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[resources]._index.tsx index 7e6c36bc09a5..0f42ed0f0af8 100644 --- a/fixtures/webstudio-remix-vercel/app/routes/[resources]._index.tsx +++ b/fixtures/webstudio-remix-vercel/app/routes/[resources]._index.tsx @@ -267,7 +267,10 @@ export const action = async ({ const submitTime = parseInt(formBotValue, 16); // 5 minutes - if (Math.abs(Date.now() - submitTime) > 1000 * 60 * 5) { + if ( + Number.isNaN(submitTime) || + Math.abs(Date.now() - submitTime) > 1000 * 60 * 5 + ) { throw new Error(`Form bot value invalid ${formBotValue}`); } diff --git a/fixtures/webstudio-remix-vercel/app/routes/_index.tsx b/fixtures/webstudio-remix-vercel/app/routes/_index.tsx index e8340acd13fb..7857f961298c 100644 --- a/fixtures/webstudio-remix-vercel/app/routes/_index.tsx +++ b/fixtures/webstudio-remix-vercel/app/routes/_index.tsx @@ -267,7 +267,10 @@ export const action = async ({ const submitTime = parseInt(formBotValue, 16); // 5 minutes - if (Math.abs(Date.now() - submitTime) > 1000 * 60 * 5) { + if ( + Number.isNaN(submitTime) || + Math.abs(Date.now() - submitTime) > 1000 * 60 * 5 + ) { throw new Error(`Form bot value invalid ${formBotValue}`); } diff --git a/packages/cli/templates/defaults/app/route-templates/html.tsx b/packages/cli/templates/defaults/app/route-templates/html.tsx index 8fabbe4a4524..970ca1d4cd91 100644 --- a/packages/cli/templates/defaults/app/route-templates/html.tsx +++ b/packages/cli/templates/defaults/app/route-templates/html.tsx @@ -267,7 +267,10 @@ export const action = async ({ const submitTime = parseInt(formBotValue, 16); // 5 minutes - if (Math.abs(Date.now() - submitTime) > 1000 * 60 * 5) { + if ( + Number.isNaN(submitTime) || + Math.abs(Date.now() - submitTime) > 1000 * 60 * 5 + ) { throw new Error(`Form bot value invalid ${formBotValue}`); }