From 8817aed22e5b64e6094fd7996bdb64630a409091 Mon Sep 17 00:00:00 2001 From: Marshall Polaris Date: Wed, 17 Aug 2022 14:12:03 -0700 Subject: [PATCH] Remove dead image storage code --- web/lib/firebase/users.ts | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/web/lib/firebase/users.ts b/web/lib/firebase/users.ts index ac0eb099..7db087b9 100644 --- a/web/lib/firebase/users.ts +++ b/web/lib/firebase/users.ts @@ -14,7 +14,6 @@ import { onSnapshot, } from 'firebase/firestore' import { getAuth } from 'firebase/auth' -import { ref, getStorage, uploadBytes, getDownloadURL } from 'firebase/storage' import { GoogleAuthProvider, signInWithPopup } from 'firebase/auth' import { zip } from 'lodash' import { app, db } from './init' @@ -202,20 +201,6 @@ export async function firebaseLogout() { await auth.signOut() } -const storage = getStorage(app) -// Example: uploadData('avatars/ajfi8iejsf.png', data) -export async function uploadData( - path: string, - data: ArrayBuffer | Blob | Uint8Array -) { - const uploadRef = ref(storage, path) - // Uploaded files should be cached for 1 day, then revalidated - // See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control - const metadata = { cacheControl: 'public, max-age=86400, must-revalidate' } - await uploadBytes(uploadRef, data, metadata) - return await getDownloadURL(uploadRef) -} - export async function listUsers(userIds: string[]) { if (userIds.length > 10) { throw new Error('Too many users requested at once; Firestore limits to 10')