@@ -24,14 +24,18 @@ final class AccountViewController: BaseViewController {
24
24
tableView. anchors. edges. pin ( )
25
25
tableView. separatorStyle = . singleLine
26
26
tableView. cellLayoutMarginsFollowReadableWidth = true
27
- // tableView.delaysContentTouches = false
28
27
tableView. deselectsCellsAutomatically = true
28
+ tableView. tableFooterView = UIView ( )
29
29
30
30
createTable ( )
31
31
}
32
32
}
33
33
34
34
func reloadTable( ) {
35
+ guard isViewLoaded else {
36
+ return
37
+ }
38
+
35
39
tableView. rows = [ ]
36
40
createTable ( )
37
41
tableView. reloadData ( )
@@ -43,7 +47,9 @@ final class AccountViewController: BaseViewController {
43
47
var title = " ⚠️ Not Signed In "
44
48
var message : String ? = " Sign up below to unlock benefits of a Lockdown account. "
45
49
var firstButton = DefaultCell ( title: NSLocalizedString ( " Sign Up | Sign In " , comment: " " ) , height: buttonHeight, dismissOnTap: true ) {
46
- self . performSegue ( withIdentifier: " showCreateAccountFromHome " , sender: self )
50
+ AccountUI . presentCreateAccount ( on: self ) { [ weak self] in
51
+ self ? . reloadTable ( )
52
+ }
47
53
}
48
54
49
55
if let apiCredentials = getAPICredentials ( ) {
@@ -120,7 +126,7 @@ final class AccountViewController: BaseViewController {
120
126
completion: nil )
121
127
popup. addButtons ( [
122
128
DefaultButton ( title: NSLocalizedString ( " Okay " , comment: " " ) , dismissOnTap: true ) {
123
- // self.reloadMenuDot ()
129
+ self . reloadTable ( )
124
130
}
125
131
] )
126
132
self . present ( popup, animated: true , completion: nil )
@@ -144,8 +150,8 @@ final class AccountViewController: BaseViewController {
144
150
Client . clearCookies ( )
145
151
clearAPICredentials ( )
146
152
setAPICredentialsConfirmed ( confirmed: false )
147
- // self.reloadMenuDot ()
148
- // self.showPopupDialog(title: "Success", message: "Signed out successfully.", acceptButton: NSLocalizedString("Okay", comment: ""))
153
+ self . reloadTable ( )
154
+ self . showPopupDialog ( title: " Success " , message: " Signed out successfully. " , acceptButton: NSLocalizedString ( " Okay " , comment: " " ) )
149
155
} ,
150
156
DefaultButton ( title: NSLocalizedString ( " Re-send " , comment: " " ) , dismissOnTap: true ) {
151
157
firstly {
@@ -156,20 +162,20 @@ final class AccountViewController: BaseViewController {
156
162
if ( success == false ) {
157
163
message = " Failed to re-send email confirmation. "
158
164
}
159
- // self.showPopupDialog(title: "", message: message, acceptButton: NSLocalizedString("Okay", comment: ""))
165
+ self . showPopupDialog ( title: " " , message: message, acceptButton: NSLocalizedString ( " Okay " , comment: " " ) )
160
166
}
161
167
. catch { error in
162
- // if (self.popupErrorAsNSURLError(error)) {
163
- // return
164
- // }
165
- // else if let apiError = error as? ApiError {
166
- // _ = self.popupErrorAsApiError(apiError)
167
- // }
168
- // else {
169
- // self.showPopupDialog(title: NSLocalizedString("Error Re-sending Email Confirmation", comment: ""),
170
- // message: "\(error)",
171
- // acceptButton: NSLocalizedString("Okay", comment: ""))
172
- // }
168
+ if ( self . popupErrorAsNSURLError ( error) ) {
169
+ return
170
+ }
171
+ else if let apiError = error as? ApiError {
172
+ _ = self . popupErrorAsApiError ( apiError)
173
+ }
174
+ else {
175
+ self . showPopupDialog ( title: NSLocalizedString ( " Error Re-sending Email Confirmation " , comment: " " ) ,
176
+ message: " \( error) " ,
177
+ acceptButton: NSLocalizedString ( " Okay " , comment: " " ) )
178
+ }
173
179
}
174
180
} ,
175
181
] )
@@ -344,9 +350,8 @@ func DefaultButtonCell(title: String, height: Int, dismissOnTap: Bool, action: @
344
350
cell. button. isUserInteractionEnabled = false
345
351
cell. button. titleLabel? . font = fontSemiBold17
346
352
cell. button. tintColor = . tunnelsBlue
347
- // cell.label.textColor = .tunnelsBlue
348
- // cell.label.textAlignment = .center
349
353
cell. contentView. addSubview ( cell. button)
354
+ cell. button. anchors. height. equal ( 21 )
350
355
cell. button. anchors. edges. marginsPin ( insets: . init( top: 8 , left: 0 , bottom: 8 , right: 0 ) )
351
356
return cell. onSelect ( callback: action)
352
357
}
0 commit comments