Skip to content

Commit

Permalink
fix double initialistation
Browse files Browse the repository at this point in the history
  • Loading branch information
choden-dev committed Oct 19, 2024
1 parent 2d249a4 commit 82adaed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 3 additions & 1 deletion client/src/firebase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { MembershipPaymentStore } from "@/store/MembershipPayment"
import queryClient from "@/services/QueryClient"
import { BOOKING_AVAILABLITY_KEY } from "@/services/Booking/BookingQueries"
import { MEMBERSHIP_CLIENT_SECRET_KEY } from "@/services/Payment/PaymentQueries"
import { getStorage } from "firebase/storage"

const firebaseConfig: FirebaseOptions = {
apiKey: process.env.NEXT_PUBLIC_FIREBASE_API_KEY,
Expand All @@ -31,6 +32,7 @@ const firebaseConfig: FirebaseOptions = {
const app = initializeApp(firebaseConfig)
const auth = getAuth(app)
const db = getFirestore(app)
const storage = getStorage(app)
let analytics: Analytics | null = null

isSupported().then((yes) => {
Expand Down Expand Up @@ -80,4 +82,4 @@ export const fireAnalytics = (
}
}

export { auth, db, analytics }
export { auth, db, analytics, storage }
6 changes: 2 additions & 4 deletions client/src/services/Storage/StorageService.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { storage } from "@/firebase"
import {
getDownloadURL,
ref as storageRef,
uploadBytes,
getStorage
uploadBytes
} from "firebase/storage"

const storage = getStorage()

// https://stackoverflow.com/a/19842865
const uid = () => {
return Date.now().toString(36) + Math.random().toString(36).substr(2)
Expand Down

0 comments on commit 82adaed

Please sign in to comment.