Skip to content

Commit

Permalink
fix: fix getApps call for correct Firebase initialization (#295)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelessiet authored Feb 25, 2025
2 parents e2ff81e + 95c936e commit 2faf445
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const firebaseConfig = {
appId: process.env.NEXT_PUBLIC_FIREBASE_APP_ID,
measurementId: process.env.NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID,
};
const app = !getApps.length ? initializeApp(firebaseConfig) : getApp();
const app = getApps().length === 0 ? initializeApp(firebaseConfig) : getApp();
const db = getFirestore(app);

async function getOrCreateUserKeyPair(userId: string) {
Expand Down Expand Up @@ -154,4 +154,4 @@ export const POST = async (req: Request) => {
headers.set('x-vercel-background', 'true');
const handler = webhookCallback(bot, 'std/http');
return handler(req);
};
};

0 comments on commit 2faf445

Please sign in to comment.