-
Notifications
You must be signed in to change notification settings - Fork 3
fix: allow users to exit out of create instance #2512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: stage
Are you sure you want to change the base?
Changes from all commits
7964899
6c8ec27
2e79fc8
4decb8d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ import { useState, useRef, useCallback } from 'react'; | |
| import { useTheme } from '@emotion/react'; | ||
| import { Box, Grid, Stack, Typography } from '@mui/material'; | ||
| import React from 'react'; | ||
| import { useRouter } from 'next/router'; | ||
|
|
||
| // confetti | ||
| import Confetti from 'react-confetti'; | ||
|
|
@@ -65,6 +66,7 @@ const getTemplate = async (zuid, setrepository, isProduction) => { | |
| }); | ||
| }; | ||
| export default function Start(props) { | ||
| const router = useRouter(); | ||
| const params = new URLSearchParams( | ||
| typeof window !== 'undefined' && window.location.search, | ||
| ); | ||
|
|
@@ -102,10 +104,16 @@ export default function Start(props) { | |
| const handlePrev = useCallback(() => { | ||
| if (currentStep > 1) { | ||
| setCurrentStep(currentStep - 1); | ||
|
|
||
| if (sliderRef.current) { | ||
| sliderRef.current.swiper.slidePrev(); | ||
| } | ||
|
|
||
| return; | ||
| } | ||
| if (!sliderRef.current) return; | ||
| sliderRef.current.swiper.slidePrev(); | ||
| }, [currentStep]); | ||
|
|
||
| router.back(); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Consider falling back to a known route when there's no history: if (window.history.length > 1) {
router.back();
} else {
router.push('/');
}Same caveat applies if the previous entry was external (e.g., Google) — |
||
| }, [currentStep, router]); | ||
|
|
||
| // moves user forward a slide in the onboard process | ||
| const handleNext = useCallback(() => { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.