Skip to content

Commit

Permalink
fix: disabled the default form redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
JimmyLv committed Mar 13, 2023
1 parent bca163c commit e8c3068
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pages/[...slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { NextPage } from "next";
import { useSearchParams } from "next/navigation";
import { useRouter } from "next/router";
import React, { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { SubmitHandler, useForm } from "react-hook-form";
import useFormPersist from "react-hook-form-persist";
import { useAnalytics } from "~/components/context/analytics";
import { PromptOptions } from "~/components/PromptOptions";
Expand Down Expand Up @@ -153,8 +153,8 @@ export const Home: NextPage<{
window.scrollTo({ top: document.body.scrollHeight, behavior: "smooth" });
}, 10);
};
const onFormSubmit = async (e: any) => {
e.preventDefault();
const onFormSubmit: SubmitHandler<VideoConfigSchema> = async (data) => {
// e.preventDefault();
await generateSummary(currentVideoUrl);
analytics.track("GenerateButton Clicked");
};
Expand Down Expand Up @@ -183,7 +183,7 @@ export const Home: NextPage<{
<TypingSlogan />
<UsageAction />
<UserKeyInput value={userKey} onChange={handleApiKeyChange} />
<form onSubmit={onFormSubmit} className="grid place-items-center">
<form onSubmit={handleSubmit(onFormSubmit)} className="grid place-items-center">
<input
type="text"
value={currentVideoUrl}
Expand Down

1 comment on commit e8c3068

@vercel
Copy link

@vercel vercel bot commented on e8c3068 Mar 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.