adding redirect after waitlist success

This commit is contained in:
itsamejms
2026-03-05 17:42:19 +00:00
parent 7a096c13e9
commit e253e1cbc5
2 changed files with 6 additions and 2 deletions
+1 -1
View File
@@ -6,7 +6,7 @@
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "vite build", "build": "vite build",
"postbuild": "node ./scripts/postbuild.cjs", "postbuild": "node ./scripts/postbuild.cjs",
"predeploy": "npm run build", "predeploy": "npm run build",
"deploy": "gh-pages -d dist", "deploy": "gh-pages -d dist",
"build:dev": "vite build --mode development", "build:dev": "vite build --mode development",
+4
View File
@@ -28,6 +28,10 @@ const Waitlist: React.FC = () => {
toast({ title: "Success", description: "You've been added to the waitlist." }); toast({ title: "Success", description: "You've been added to the waitlist." });
setName(""); setName("");
setEmail(""); setEmail("");
// redirect to home after 0.5 seconds
setTimeout(() => {
window.location.href = "/";
}, 500);
} catch (err: any) { } catch (err: any) {
toast({ title: "Error", description: err?.message ?? String(err) }); toast({ title: "Error", description: err?.message ?? String(err) });
} finally { } finally {