From 79648992f7f80cef3c43995d764fbc72aa9ac48a Mon Sep 17 00:00:00 2001 From: Nar Cuenca Date: Fri, 10 Oct 2025 07:50:59 +0800 Subject: [PATCH 1/2] fix: allow users toexit out of create instance --- src/pages/start.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/pages/start.js b/src/pages/start.js index c914c8f25..5fe0363aa 100644 --- a/src/pages/start.js +++ b/src/pages/start.js @@ -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,9 +104,15 @@ export default function Start(props) { const handlePrev = useCallback(() => { if (currentStep > 1) { setCurrentStep(currentStep - 1); + + if (!sliderRef.current) { + return; + } + + sliderRef.current.swiper.slidePrev(); } - if (!sliderRef.current) return; - sliderRef.current.swiper.slidePrev(); + + router.back(); }, [currentStep]); // moves user forward a slide in the onboard process From 2e79fc82318e7017b1761a7e1b1c1bb3dd476389 Mon Sep 17 00:00:00 2001 From: Nar Cuenca Date: Thu, 28 May 2026 07:44:40 +0800 Subject: [PATCH 2/2] Resolve bug where handlePrev always falls through to router.back() --- src/pages/start.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pages/start.js b/src/pages/start.js index 5fe0363aa..efd063efe 100644 --- a/src/pages/start.js +++ b/src/pages/start.js @@ -105,15 +105,15 @@ export default function Start(props) { if (currentStep > 1) { setCurrentStep(currentStep - 1); - if (!sliderRef.current) { - return; + if (sliderRef.current) { + sliderRef.current.swiper.slidePrev(); } - sliderRef.current.swiper.slidePrev(); + return; } router.back(); - }, [currentStep]); + }, [currentStep, router]); // moves user forward a slide in the onboard process const handleNext = useCallback(() => {