//
//  ViewController.swift
//  Mindtap_Official
//
//  Created by Lunar on 5/25/21.
//

import UIKit
import FirebaseAuth

class MainMenu: UIViewController {

    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        
        // Do any additional setup after loading the view.
    }
    
    @IBAction func profilePressed(_ sender: UIButton) {
        Auth.auth().addStateDidChangeListener { auth, user in
            if user != nil {
                //user is signed in
                self.performSegue(withIdentifier: "profileLoggedIn", sender: self)
            } else {
                //user not signed in
                self.performSegue(withIdentifier: "profileNotLoggedIn", sender: self)
            }
        }
        
    }
    

    @IBAction func formsPressed(_ sender: Any) {
        Auth.auth().addStateDidChangeListener { auth, user in
            
            if user != nil {
                self.performSegue(withIdentifier: "FormChoices", sender: self)
            } else{
                self.performSegue(withIdentifier: "profileNotLoggedIn", sender: self)
            }
            
            
            
        }
        
    }
    
}

