Add and store user preferences

This commit is contained in:
Conor McNamara
2023-03-15 12:04:58 +00:00
parent 97ff51e5d4
commit 89dcd43afe
4 changed files with 94 additions and 38 deletions

View File

@ -34,6 +34,7 @@
<script>
import app from "../api/firebase"
import { getAuth, onAuthStateChanged, signOut } from "firebase/auth"
import { store } from '../store/store'
export default {
name: "Navbar",
@ -49,6 +50,7 @@ export default {
const auth = getAuth(app);
onAuthStateChanged(auth, (user) => {
user ? this.isLoggedIn = true : this.isLoggedIn = false
store.setLoginStatus(this.isLoggedIn)
})
},