File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed
SNUTT/Modules/Feature/Auth/Sources/UI Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ struct TimerView: View {
1313 let onRestart : ( ( ) async -> Void ) ?
1414 let onTimeout : ( ( ) -> Void ) ?
1515
16- @State private var timeOut = false
16+ @State private var isTimedOut = false
1717 @State private var endDate : Date
1818 @State private var didTimeout = false
1919 @State private var restartTrigger = 0
@@ -34,7 +34,7 @@ struct TimerView: View {
3434 let remaining = remainingTime ( now: context. date)
3535
3636 HStack ( spacing: 4 ) {
37- if onRestart != nil && timeOut {
37+ if onRestart != nil && isTimedOut {
3838 Button {
3939 Task {
4040 await onRestart ? ( )
@@ -55,14 +55,14 @@ struct TimerView: View {
5555 . onChange ( of: remaining) { newValue in
5656 if newValue == 0 , !didTimeout {
5757 didTimeout = true
58- timeOut = true
58+ isTimedOut = true
5959 onTimeout ? ( )
6060 }
6161 }
6262 }
6363 . task ( id: restartTrigger) {
6464 endDate = Date ( ) . addingTimeInterval ( TimeInterval ( initialRemainingTime) )
65- timeOut = false
65+ isTimedOut = false
6666 didTimeout = false
6767 }
6868 }
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ struct VerificationCodeScene: View {
1616
1717 @State private var verificationCode = " "
1818 @State private var showHelpAlert = false
19- @State private var timeOut = false
19+ @State private var isTimedOut = false
2020 @State private var isLoading = false
2121
2222 @FocusState private var isFocused : Bool
@@ -60,6 +60,7 @@ struct VerificationCodeScene: View {
6060 initialRemainingTime: 180 ,
6161 onRestart: {
6262 errorAlertHandler. withAlert {
63+ isTimedOut = false
6364 if mode == . resetPassword {
6465 try await viewModel. sendResetPasswordCode ( email: email)
6566 } else {
@@ -68,12 +69,12 @@ struct VerificationCodeScene: View {
6869 }
6970 } ,
7071 onTimeout: {
71- timeOut = true
72+ isTimedOut = true
7273 }
7374 )
7475 }
7576
76- if timeOut {
77+ if isTimedOut {
7778 Text ( AuthStrings . verificationCodeTimeout)
7879 . font ( . system( size: 13 ) )
7980 . foregroundColor ( SharedUIComponentsAsset . red. swiftUIColor)
@@ -83,7 +84,7 @@ struct VerificationCodeScene: View {
8384 VStack ( spacing: 20 ) {
8485 ProminentButton (
8586 label: AuthStrings . verificationCodeButton,
86- isEnabled: verificationCode. count == codeLength && !timeOut && !isLoading
87+ isEnabled: verificationCode. count == codeLength && !isTimedOut && !isLoading
8788 ) {
8889 submit ( )
8990 }
You can’t perform that action at this time.
0 commit comments