decrypt notes
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
// import { initializeApp } from 'firebase/app'
|
||||
import firebase from 'firebase/compat/app'
|
||||
import type { User } from '@firebase/auth-types'
|
||||
import { getFirestore } from 'firebase/firestore'
|
||||
import type { Firestore } from 'firebase/firestore'
|
||||
|
||||
// import { getAnalytics } from "firebase/analytics";
|
||||
// TODO: Add SDKs for Firebase products that you want to use
|
||||
@@ -21,14 +23,17 @@ const firebaseConfig = {
|
||||
|
||||
export const user = ref<User | null>()
|
||||
|
||||
// Initialize Firebase
|
||||
export const initializeFirebase = () => {
|
||||
firebase.initializeApp(firebaseConfig)
|
||||
firebase.auth().onAuthStateChanged((firebaseUser) => {
|
||||
user.value = firebaseUser
|
||||
})
|
||||
}
|
||||
|
||||
export const initialized = computed<boolean>(() => user.value !== undefined)
|
||||
|
||||
export const signOut = () => firebase.auth().signOut()
|
||||
|
||||
export const db = ref<Firestore>()
|
||||
|
||||
// Initialize Firebase
|
||||
export const initializeFirebase = () => {
|
||||
const app = firebase.initializeApp(firebaseConfig)
|
||||
firebase.auth().onAuthStateChanged((firebaseUser) => {
|
||||
user.value = firebaseUser
|
||||
})
|
||||
db.value = getFirestore(app)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user