Skip to content

Commit

Permalink
Fix v3.0.0 config and peerDependencies issue (#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkopaderes authored Nov 17, 2022
1 parent 0253e27 commit 198c0b2
Show file tree
Hide file tree
Showing 3 changed files with 569 additions and 639 deletions.
8 changes: 4 additions & 4 deletions addon/instance-initializers/firebase-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ interface AuthAddonConfig {

interface AddonConfig {
firebaseConfig: FirebaseOptions,
firestore: FirestoreAddonConfig;
auth: AuthAddonConfig;
firestore?: FirestoreAddonConfig;
auth?: AuthAddonConfig;
}

function getDb(app: FirebaseApp, config: FirestoreAddonConfig): Firestore {
Expand Down Expand Up @@ -61,11 +61,11 @@ function setupAuth(app: FirebaseApp, config: AuthAddonConfig) {
function setupModularInstance(config: AddonConfig) {
const app = initializeApp(config.firebaseConfig);

if (!config.firestore.isCustomSetup) {
if (config.firestore && !config.firestore.isCustomSetup) {
setupFirestore(app, config.firestore);
}

if (!config.auth.isCustomSetup) {
if (config.auth && !config.auth?.isCustomSetup) {
setupAuth(app, config.auth);
}
}
Expand Down
Loading

0 comments on commit 198c0b2

Please sign in to comment.