Move getStorage() into init.ts after initializeApp() is called.
This commit is contained in:
parent
deaa595f07
commit
0c328bc398
|
@ -1,5 +1,6 @@
|
|||
import { getFirestore } from '@firebase/firestore'
|
||||
import { initializeApp, getApps, getApp } from 'firebase/app'
|
||||
import { getStorage } from 'firebase/storage'
|
||||
import { FIREBASE_CONFIG } from 'common/envs/constants'
|
||||
import { connectFirestoreEmulator } from 'firebase/firestore'
|
||||
import { connectFunctionsEmulator, getFunctions } from 'firebase/functions'
|
||||
|
@ -8,6 +9,7 @@ import { connectFunctionsEmulator, getFunctions } from 'firebase/functions'
|
|||
export const app = getApps().length ? getApp() : initializeApp(FIREBASE_CONFIG)
|
||||
export const db = getFirestore()
|
||||
export const functions = getFunctions()
|
||||
export const storage = getStorage()
|
||||
|
||||
declare global {
|
||||
/* eslint-disable-next-line no-var */
|
||||
|
|
|
@ -1,11 +1,5 @@
|
|||
import {
|
||||
getStorage,
|
||||
ref,
|
||||
uploadBytesResumable,
|
||||
getDownloadURL,
|
||||
} from 'firebase/storage'
|
||||
|
||||
const storage = getStorage()
|
||||
import { ref, uploadBytesResumable, getDownloadURL } from 'firebase/storage'
|
||||
import { storage } from './init'
|
||||
|
||||
// TODO: compress large images
|
||||
export const uploadImage = async (
|
||||
|
|
Loading…
Reference in New Issue
Block a user