File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -85,6 +85,9 @@ export function RegisterPage() {
8585
8686 const register = useRegister ( ) ;
8787
88+ // 새로고침 시 googleToken이 날아가면 1단계로 리셋
89+ const currentStep = state . step > 1 && ! state . googleToken ? 1 : state . step ;
90+
8891 const handleEmailComplete = async ( email : string ) => {
8992 dispatch ( { type : "SET_EMAIL" , schoolEmail : email } ) ;
9093 try {
@@ -115,10 +118,10 @@ export function RegisterPage() {
115118 </ Alert >
116119 </ div >
117120 < CardHeader >
118- < Stepper steps = { STEPS } currentStep = { state . step } />
121+ < Stepper steps = { STEPS } currentStep = { currentStep } />
119122 </ CardHeader >
120123 < CardContent >
121- { state . step === 1 && (
124+ { currentStep === 1 && (
122125 < GoogleStep
123126 onComplete = { ( token ) =>
124127 dispatch ( {
@@ -129,7 +132,7 @@ export function RegisterPage() {
129132 }
130133 />
131134 ) }
132- { state . step === 2 && (
135+ { currentStep === 2 && (
133136 < ProfileStep
134137 defaultName = { state . name || state . googleName }
135138 defaultDepartment = { state . department }
@@ -142,7 +145,7 @@ export function RegisterPage() {
142145 }
143146 />
144147 ) }
145- { state . step === 3 && (
148+ { currentStep === 3 && (
146149 < EmailStep
147150 defaultEmail = { state . schoolEmail }
148151 onBack = { ( ) => dispatch ( { type : "GO_BACK" } ) }
You can’t perform that action at this time.
0 commit comments