From 9bb4d0ccf16d148ff0ccbdc4795ff0c7f01de7ed Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Fri, 22 Jan 2021 16:54:20 -0500 Subject: [PATCH] [+] Automatically check login status on start --- ProjectClock/AccountViewController.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ProjectClock/AccountViewController.swift b/ProjectClock/AccountViewController.swift index 41da347..30f00bf 100644 --- a/ProjectClock/AccountViewController.swift +++ b/ProjectClock/AccountViewController.swift @@ -15,9 +15,17 @@ class AccountViewController: UIViewController // For instance references static var this: AccountViewController! + /** + Called when the user switch to this tab + */ override func viewDidLoad() { + // Static instance reference AccountViewController.this = self + + // Check if already registered/logged in + if localStorage["id"] != nil { login() } + super.viewDidLoad() }