KMSignUpView.swift 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494
  1. //
  2. // KMSignUpView.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by wanjun on 2024/10/23.
  6. //
  7. import Cocoa
  8. import Combine
  9. class KMSignUpView: KMBaseXibView {
  10. @IBOutlet weak var signUpLabel: NSTextField!
  11. @IBOutlet weak var loginModeBox: NSBox!
  12. @IBOutlet weak var verificationCodeButton: NSButton!
  13. @IBOutlet weak var selectBox1: NSBox!
  14. @IBOutlet weak var passwordButton: NSButton!
  15. @IBOutlet weak var selectBox2: NSBox!
  16. @IBOutlet weak var emailBox: NSBox!
  17. @IBOutlet weak var emailTextField: NSTextField!
  18. @IBOutlet weak var emailErrorLabel: NSTextField!
  19. @IBOutlet weak var passwordBox: NSBox!
  20. @IBOutlet weak var verifficationView: NSView!
  21. @IBOutlet weak var verifficationBox: NSBox!
  22. @IBOutlet weak var verifficationTextField: NSTextField!
  23. @IBOutlet weak var sendBox: KMBox!
  24. @IBOutlet weak var sendLabel: NSTextField!
  25. @IBOutlet weak var passwordView: NSView!
  26. @IBOutlet weak var passwordTextField: NSTextField!
  27. @IBOutlet weak var passwordTextField1: NSSecureTextField!
  28. @IBOutlet weak var visibleButton: NSButton!
  29. @IBOutlet weak var passwordErrorLabel: NSTextField!
  30. @IBOutlet weak var stayCheckButton: NSButton!
  31. @IBOutlet weak var stayLabel: NSTextField!
  32. @IBOutlet weak var forgetButton: NSButton!
  33. @IBOutlet weak var signUpBox: NSBox!
  34. @IBOutlet weak var signUpButton: NSButton!
  35. @IBOutlet weak var privacyCheckButton: NSButton!
  36. @IBOutlet weak var privacyLabel: NSTextField!
  37. private var viewModel = KMSignUpViewModel()
  38. private var cancellables = Set<AnyCancellable>()
  39. convenience init(model: KMSignUpViewModel, superView: NSView) {
  40. self.init(frame: superView.bounds)
  41. viewModel = model
  42. viewModel.screenType = .signUp
  43. bindViewModel()
  44. languageLocalized()
  45. initializeUI()
  46. }
  47. public override init(frame frameRect: NSRect) {
  48. super.init(frame: frameRect)
  49. }
  50. public required init?(coder decoder: NSCoder) {
  51. fatalError("init(coder:) has not been implemented")
  52. }
  53. public func resetTextFileData() {
  54. if(self.superview != nil) {
  55. emailTextField.stringValue = ""
  56. passwordTextField.stringValue = ""
  57. passwordTextField1.stringValue = ""
  58. verifficationTextField.stringValue = ""
  59. emailErrorLabel.isHidden = true
  60. passwordErrorLabel.isHidden = true
  61. sendLabel.stringValue = NSLocalizedString("Send", tableName: "MemberCenterLocalizable", comment: "")
  62. viewModel.sendContent = NSLocalizedString("Send", tableName: "MemberCenterLocalizable", comment: "")
  63. viewModel.email = ""
  64. sendBoxRefresh()
  65. }
  66. }
  67. override func updateUI() {
  68. super.updateUI()
  69. NotificationCenter.default.addObserver(self, selector: #selector(loginSuccessNotification), name: NSNotification.Name(rawValue: "MemberCenterLoginSuccess"), object: nil)
  70. bindViewModel()
  71. languageLocalized()
  72. initializeUI()
  73. }
  74. // MARK: Private Method
  75. private func languageLocalized() -> Void {
  76. signUpLabel.stringValue = NSLocalizedString("Sign in(titile)", tableName: "MemberCenterLocalizable", comment: "")
  77. verificationCodeButton.title = NSLocalizedString("Verification Code", tableName: "MemberCenterLocalizable", comment: "")
  78. passwordButton.title = NSLocalizedString("Password", tableName: "MemberCenterLocalizable", comment: "")
  79. stayLabel.stringValue = NSLocalizedString("Stay signed in", tableName: "MemberCenterLocalizable", comment: "")
  80. forgetButton.title = NSLocalizedString("Forgot password?", tableName: "MemberCenterLocalizable", comment: "")
  81. signUpButton.title = NSLocalizedString("Sign in(button)", tableName: "MemberCenterLocalizable", comment: "")
  82. emailErrorLabel.stringValue = String(format: "*%@", NSLocalizedString("Email format error. Please enter the correct email.", tableName: "MemberCenterLocalizable", comment: ""))
  83. passwordErrorLabel.stringValue = String(format: "*%@", NSLocalizedString("Verification code error.", tableName: "MemberCenterLocalizable", comment: ""))
  84. emailTextField.placeholderString = NSLocalizedString("Please enter email address", tableName: "MemberCenterLocalizable", comment: "")
  85. verifficationTextField.placeholderString = NSLocalizedString("Please enter code", tableName: "MemberCenterLocalizable", comment: "")
  86. passwordTextField.placeholderString = NSLocalizedString("Please enter password", tableName: "MemberCenterLocalizable", comment: "")
  87. passwordTextField1.placeholderString = NSLocalizedString("Please enter password", tableName: "MemberCenterLocalizable", comment: "")
  88. privacyCheckButton.toolTip = NSLocalizedString("Please agree and check the above agreement first.", tableName: "MemberCenterLocalizable", comment: "")
  89. emailTextField.stringValue = viewModel.email
  90. verifficationTextField.stringValue = viewModel.verificationCode
  91. passwordTextField.stringValue = viewModel.password
  92. passwordTextField1.stringValue = viewModel.password
  93. }
  94. private func initializeUI() -> Void {
  95. emailBox.fillColor = NSColor(named: "texefiedfillcolor") ?? NSColor.white
  96. passwordBox.fillColor = NSColor(named: "texefiedfillcolor") ?? NSColor.white
  97. emailTextField.delegate = self
  98. verifficationTextField.delegate = self
  99. passwordTextField.delegate = self
  100. passwordTextField1.delegate = self
  101. emailErrorLabel.isHidden = !viewModel.emailError()
  102. passwordErrorLabel.isHidden = !viewModel.passwordError()
  103. signUpLabel.textColor = NSColor(named: "000000")
  104. signUpLabel.font = NSFont.SFMediumFontWithSize(20)
  105. selectBox1.fillColor = NSColor(named: "4982E6") ?? NSColor.blue
  106. emailErrorLabel.textColor = NSColor(named: "FA1E5D")
  107. emailErrorLabel.font = NSFont.SFProTextRegularFont(9)
  108. passwordBox.borderColor = NSColor(named: "DADBDE") ?? NSColor.gray
  109. verifficationBox.borderColor = NSColor(named: "FA1E5D") ?? NSColor.gray
  110. if viewModel.isValidEmail() {
  111. sendBox.fillColor = NSColor(named: "273C62") ?? NSColor.blue
  112. } else {
  113. sendBox.fillColor = NSColor(named: "273C62_0.4") ?? NSColor.blue
  114. }
  115. sendBox.borderColor = NSColor(named: "273C62") ?? NSColor.blue
  116. sendLabel.textColor = NSColor(named: "FFFFFF") ?? NSColor.white
  117. sendLabel.font = NSFont.SFProTextRegularFont(13)
  118. passwordErrorLabel.textColor = NSColor(named: "FA1E5D")
  119. passwordErrorLabel.font = NSFont.SFProTextRegularFont(9)
  120. stayCheckButton.image = NSImage(named: "CheckBoxNor")
  121. stayLabel.textColor = NSColor(named: "0E1114") ?? NSColor.black
  122. stayLabel.font = NSFont.SFProTextRegularFont(12)
  123. forgetButton.setTitleColor(color: NSColor(named: "4982E6") ?? NSColor.blue, font: NSFont.SFProTextRegularFont(12))
  124. signUpBox.fillColor = NSColor(named: "273C62") ?? NSColor.blue
  125. signUpButton.setTitleColor(color: NSColor(named: "FFFFFF") ?? NSColor.white, font: NSFont.SFProTextRegularFont(16))
  126. privacyCheckButton.image = NSImage(named: "CheckBoxNor")
  127. privacyLabel.isEditable = false
  128. privacyLabel.isSelectable = true
  129. privacyLabel.allowsEditingTextAttributes = true
  130. privacyLabel.textColor = NSColor.black
  131. privacyLabel.font = NSFont.SFProTextRegularFont(16.0)
  132. let tipsString = NSLocalizedString("I have read and agreed to the %@ and %@. An account will be automatically created after signing in with an unregistered email address.", tableName: "MemberCenterLocalizable", comment: "")
  133. let specialOffer = NSLocalizedString("Terms of Service", tableName: "MemberCenterLocalizable", comment: "")
  134. let contactsUs = NSLocalizedString("Privacy Policy", tableName: "MemberCenterLocalizable", comment: "")
  135. let fullString = String(format: tipsString, specialOffer, contactsUs)
  136. let attributedString = NSMutableAttributedString(string: fullString)
  137. // 定义链接的范围
  138. let specialOfferRange = (fullString as NSString).range(of: specialOffer)
  139. let contactsUsRange = (fullString as NSString).range(of: contactsUs)
  140. let linkColor = NSColor(named: "4982E6") ?? NSColor.blue
  141. let font = NSFont.SFProTextRegularFont(11.0) // 与普通文本相同的字体
  142. attributedString.addAttributes([
  143. .foregroundColor: NSColor(named: "0E1114") ?? NSColor.black as Any,
  144. .font: font
  145. ], range: (fullString as NSString).range(of: fullString))
  146. attributedString.addAttributes([
  147. .foregroundColor: linkColor,
  148. .link: NSLocalizedString("https://www.pdfreaderpro.com/terms_of_service", comment: ""),
  149. .font: font
  150. ], range: specialOfferRange)
  151. attributedString.addAttributes([
  152. .foregroundColor: linkColor,
  153. .link: NSLocalizedString("https://www.pdfreaderpro.com/privacy-policy", comment: ""),
  154. .font: font
  155. ], range: contactsUsRange)
  156. privacyLabel.attributedStringValue = attributedString
  157. signUpStateChange()
  158. visibleStateChange()
  159. textfieldInputState(isEmail: true)
  160. textfieldInputState(isEmail: false)
  161. sendBoxRefresh()
  162. sendBox.moveCallback = { [weak self](mouseEntered: Bool, mouseBox: KMBox) -> Void in
  163. guard let self = self else { return }
  164. if self.viewModel.email.count <= 0 { return }
  165. if self.viewModel.sendBoxSelect { return }
  166. if !self.viewModel.isValidEmail() { return }
  167. if mouseEntered {
  168. self.sendBox.fillColor = NSColor(named: "000000_0.1") ?? NSColor.blue
  169. } else {
  170. self.sendBox.fillColor = NSColor(named: "273C62") ?? NSColor.blue
  171. }
  172. }
  173. sendBox.downCallback = { [weak self](downEntered: Bool, mouseBox: KMBox, event) -> Void in
  174. guard let self = self else { return }
  175. if self.viewModel.email.count <= 0 { return }
  176. if self.viewModel.sendBoxSelect { return }
  177. if downEntered {
  178. self.sendBox.fillColor = NSColor(named: "273C62_0.4") ?? NSColor.blue
  179. viewModel.countDown(type: .login)
  180. }
  181. }
  182. }
  183. private func signUpStateChange() -> Void {
  184. if viewModel.signUpState == .verificationCode {
  185. selectBox1.isHidden = false
  186. selectBox2.isHidden = true
  187. verificationCodeButton.setTitleColor(color: NSColor(named: "4982E6") ?? NSColor.systemBlue, font: NSFont.SFProTextRegularFont(14))
  188. passwordButton.setTitleColor(color: NSColor(named: "42464D") ?? NSColor.black, font: NSFont.SFProTextRegularFont(14))
  189. verifficationView.isHidden = false
  190. passwordView.isHidden = true
  191. verifficationTextField.placeholderString = NSLocalizedString("Please enter code", tableName: "MemberCenterLocalizable", comment: "")
  192. forgetButton.isHidden = true
  193. } else if viewModel.signUpState == .password {
  194. selectBox1.isHidden = true
  195. selectBox2.isHidden = false
  196. verificationCodeButton.setTitleColor(color: NSColor(named: "42464D") ?? NSColor.black, font: NSFont.SFProTextRegularFont(14))
  197. passwordButton.setTitleColor(color: NSColor(named: "4982E6") ?? NSColor.black, font: NSFont.SFProTextRegularFont(14))
  198. verifficationView.isHidden = true
  199. passwordView.isHidden = false
  200. passwordTextField.placeholderString = NSLocalizedString("Please enter password", tableName: "MemberCenterLocalizable", comment: "")
  201. passwordTextField1.placeholderString = NSLocalizedString("Please enter password", tableName: "MemberCenterLocalizable", comment: "")
  202. forgetButton.isHidden = false
  203. }
  204. }
  205. private func checkStateChange(button: NSButton!, state: Bool) -> Void {
  206. button.state = state ? .on : .off
  207. if button.state == .on {
  208. button.image = NSImage(named: "CheckBoxSel")
  209. } else {
  210. button.image = NSImage(named: "CheckBoxNor")
  211. }
  212. }
  213. private func visibleStateChange() -> Void {
  214. if viewModel.isVisible {
  215. visibleButton.image = NSImage(named: "passwordVisible")
  216. passwordTextField.isHidden = false
  217. passwordTextField1.isHidden = true
  218. passwordTextField.stringValue = viewModel.password
  219. } else {
  220. visibleButton.image = NSImage(named: "passwordUnVisible")
  221. passwordTextField.isHidden = true
  222. passwordTextField1.isHidden = false
  223. passwordTextField1.stringValue = viewModel.password
  224. }
  225. }
  226. private func textfieldInputState(isEmail: Bool) -> Void {
  227. if isEmail {
  228. if viewModel.emailError() {
  229. emailBox.borderColor = NSColor(named: "FA1E5D") ?? NSColor.red
  230. } else {
  231. emailBox.borderColor = NSColor(named: "DADBDE") ?? NSColor.gray
  232. }
  233. emailErrorLabel.isHidden = !viewModel.emailError()
  234. } else {
  235. if viewModel.passwordError() {
  236. if viewModel.signUpState == .verificationCode {
  237. passwordBox.borderWidth = 0
  238. verifficationBox.borderWidth = 1
  239. passwordBox.borderColor = NSColor(named: "DADBDE") ?? NSColor.gray
  240. verifficationBox.borderColor = NSColor(named: "FA1E5D") ?? NSColor.red
  241. } else if viewModel.signUpState == .password {
  242. passwordBox.borderWidth = 1
  243. verifficationBox.borderWidth = 0
  244. verifficationBox.borderColor = NSColor(named: "DADBDE") ?? NSColor.gray
  245. passwordBox.borderColor = NSColor(named: "FA1E5D") ?? NSColor.red
  246. }
  247. } else {
  248. if viewModel.signUpState == .verificationCode {
  249. passwordBox.borderWidth = 1
  250. verifficationBox.borderWidth = 0
  251. } else if viewModel.signUpState == .password {
  252. passwordBox.borderWidth = 1
  253. verifficationBox.borderWidth = 0
  254. }
  255. }
  256. passwordErrorLabel.isHidden = !viewModel.passwordError()
  257. }
  258. }
  259. private func sendBoxRefresh() -> Void {
  260. sendLabel.stringValue = viewModel.sendContent
  261. if viewModel.sendContent == NSLocalizedString("Send", tableName: "MemberCenterLocalizable", comment: "") ||
  262. viewModel.sendContent == NSLocalizedString("Resend", tableName: "MemberCenterLocalizable", comment: "") {
  263. if viewModel.email.count > 0 {
  264. if viewModel.isValidEmail() {
  265. sendBox.fillColor = NSColor(named: "273C62") ?? NSColor.blue
  266. } else {
  267. sendBox.fillColor = NSColor(named: "273C62_0.4") ?? NSColor.blue
  268. }
  269. } else {
  270. sendBox.fillColor = NSColor(named: "273C62_0.4") ?? NSColor.blue
  271. }
  272. sendLabel.textColor = NSColor(named: "FFFFFF") ?? NSColor.white
  273. } else {
  274. sendBox.fillColor = NSColor(named: "DADBDE") ?? NSColor.gray
  275. sendLabel.stringValue = String(format: "%@s", viewModel.sendContent)
  276. sendLabel.textColor = NSColor(named: "0E1114") ?? NSColor.black
  277. }
  278. }
  279. // MARK: Bind Method
  280. func bindViewModel() -> Void {
  281. viewModel.$isVisible
  282. .receive(on: RunLoop.main)
  283. .sink { [weak self] newValue in
  284. self?.visibleStateChange()
  285. }
  286. .store(in: &cancellables)
  287. viewModel.$stayState
  288. .receive(on: RunLoop.main)
  289. .sink { [weak self] newValue in
  290. self?.checkStateChange(button: self?.stayCheckButton, state: newValue)
  291. }
  292. .store(in: &cancellables)
  293. viewModel.$privacyState
  294. .receive(on: RunLoop.main)
  295. .sink { [weak self] newValue in
  296. self?.checkStateChange(button: self?.privacyCheckButton, state: newValue)
  297. }
  298. .store(in: &cancellables)
  299. viewModel.$signUpState
  300. .receive(on: RunLoop.main)
  301. .sink { [weak self] newValue in
  302. self?.signUpStateChange()
  303. }
  304. .store(in: &cancellables)
  305. viewModel.$emailErrorMessage
  306. .receive(on: RunLoop.main)
  307. .sink { [weak self] newValue in
  308. self?.emailErrorLabel.stringValue = newValue
  309. self?.emailErrorLabel.isHidden = false
  310. self?.textfieldInputState(isEmail: true)
  311. }
  312. .store(in: &cancellables)
  313. viewModel.$passwordErrorMessage
  314. .receive(on: RunLoop.main)
  315. .sink { [weak self] newValue in
  316. self?.passwordErrorLabel.stringValue = newValue
  317. if self?.viewModel.passwordErrorMessage == "" {
  318. self?.passwordErrorLabel.isHidden = true
  319. } else {
  320. self?.passwordErrorLabel.isHidden = false
  321. }
  322. }
  323. .store(in: &cancellables)
  324. viewModel.$sendContent
  325. .receive(on: RunLoop.main)
  326. .sink { [weak self] newValue in
  327. self?.sendBoxRefresh()
  328. }
  329. .store(in: &cancellables)
  330. viewModel.$email
  331. .receive(on: RunLoop.main)
  332. .sink { [weak self] newValue in
  333. self?.sendBoxRefresh()
  334. }
  335. .store(in: &cancellables)
  336. viewModel.$verificationCode
  337. .receive(on: RunLoop.main)
  338. .sink { [weak self] newValue in
  339. if newValue.count <= 6 && newValue.count >= 0 {
  340. self?.viewModel.passwordErrorMessage = ""
  341. } else {
  342. self?.viewModel.passwordErrorMessage = NSLocalizedString("Verification code error.", tableName: "MemberCenterLocalizable", comment: "")
  343. }
  344. }
  345. .store(in: &cancellables)
  346. viewModel.$password
  347. .receive(on: RunLoop.main)
  348. .sink { [weak self] newValue in
  349. if newValue.count <= 30 && newValue.count >= 0 {
  350. self?.viewModel.passwordErrorMessage = ""
  351. } else {
  352. self?.viewModel.passwordErrorMessage = NSLocalizedString("Account or password error.", tableName: "MemberCenterLocalizable", comment: "")
  353. }
  354. }
  355. .store(in: &cancellables)
  356. }
  357. // MARK: Action Method
  358. @IBAction func verificationCodeAction(_ sender: NSButton) {
  359. viewModel.signUpStateChange(state: .verificationCode)
  360. }
  361. @IBAction func passwordAction(_ sender: NSButton) {
  362. viewModel.signUpStateChange(state: .password)
  363. }
  364. @IBAction func visibleAction(_ sender: NSButton) {
  365. viewModel.isVisible.toggle()
  366. }
  367. @IBAction func stayCheckAction(_ sender: NSButton) {
  368. viewModel.stayState.toggle()
  369. viewModel.stayStateAction()
  370. }
  371. @IBAction func signUpAction(_ sender: NSButton) {
  372. self.window?.makeFirstResponder(nil)
  373. viewModel.emailErrorMessage = ""
  374. viewModel.passwordErrorMessage = ""
  375. viewModel.signUpAction()
  376. }
  377. @IBAction func forgetAction(_ sender: NSButton) {
  378. guard let parentView = self.superview else { return }
  379. if parentView is NSBox {
  380. let model = KMSignUpViewModel()
  381. model.email = viewModel.email
  382. let forgotView = KMForgotPasswordView(model: model, superView: parentView)
  383. NSAnimationContext.runAnimationGroup { context in
  384. context.duration = 0.3
  385. self.animator().alphaValue = 0
  386. } completionHandler: {
  387. self.removeFromSuperview()
  388. forgotView.alphaValue = 0
  389. (parentView as! NSBox).contentView = forgotView
  390. NSAnimationContext.runAnimationGroup({ context in
  391. context.duration = 0.3
  392. forgotView.animator().alphaValue = 1
  393. }, completionHandler: nil)
  394. }
  395. } else {
  396. let model = KMSignUpViewModel()
  397. model.email = viewModel.email
  398. let forgotView = KMForgotPasswordView(model: model, superView: parentView)
  399. NSAnimationContext.runAnimationGroup { context in
  400. context.duration = 0.3
  401. self.animator().alphaValue = 0
  402. } completionHandler: {
  403. self.removeFromSuperview()
  404. forgotView.alphaValue = 0
  405. parentView.addSubview(forgotView)
  406. NSAnimationContext.runAnimationGroup({ context in
  407. context.duration = 0.3
  408. forgotView.animator().alphaValue = 1
  409. }, completionHandler: nil)
  410. }
  411. }
  412. }
  413. @IBAction func privacyCheckAction(_ sender: NSButton) {
  414. viewModel.privacyState.toggle()
  415. }
  416. }
  417. extension KMSignUpView: NSTextFieldDelegate {
  418. func controlTextDidEndEditing(_ obj: Notification) {
  419. let textField = obj.object as? NSTextField
  420. if textField == emailTextField {
  421. viewModel.email = textField!.stringValue
  422. } else if textField == verifficationTextField {
  423. viewModel.verificationCode = textField!.stringValue
  424. } else if textField == passwordTextField {
  425. viewModel.password = textField!.stringValue
  426. } else if textField == passwordTextField1 {
  427. viewModel.password = textField!.stringValue
  428. }
  429. }
  430. func controlTextDidChange(_ obj: Notification) {
  431. let textField = obj.object as? NSTextField
  432. if textField == emailTextField {
  433. viewModel.emailErrorMessage = ""
  434. viewModel.email = textField!.stringValue
  435. emailBox.borderColor = NSColor(named: "DADBDE") ?? NSColor.gray
  436. } else if textField == verifficationTextField {
  437. viewModel.passwordErrorMessage = ""
  438. viewModel.verificationCode = textField!.stringValue
  439. verifficationBox.borderColor = NSColor(named: "DADBDE") ?? NSColor.gray
  440. } else if textField == passwordTextField {
  441. viewModel.passwordErrorMessage = ""
  442. viewModel.password = textField!.stringValue
  443. passwordBox.borderColor = NSColor(named: "DADBDE") ?? NSColor.gray
  444. } else if textField == passwordTextField1 {
  445. viewModel.passwordErrorMessage = ""
  446. viewModel.password = textField!.stringValue
  447. passwordBox.borderColor = NSColor(named: "DADBDE") ?? NSColor.gray
  448. }
  449. }
  450. @objc func loginSuccessNotification() -> Void {
  451. resetTextFileData()
  452. }
  453. }