Skip to content

Commit

Permalink
Use scoped firebase import. Fix #38 (#42)
Browse files Browse the repository at this point in the history
### Summary

Following firebase best practice here. See the linked issue warning for more context.

### Test Plan

Things can still run and build.
  • Loading branch information
SamChou19815 authored Feb 4, 2020
1 parent d251104 commit e1e3afd
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/components/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
</template>

<script>
import firebase from 'firebase';
import firebase from 'firebase/app';
const fb = require('../firebaseConfig.js');
Expand Down
2 changes: 1 addition & 1 deletion src/components/NavBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</template>

<script>
import firebase from 'firebase';
import firebase from 'firebase/app';
export default {
props: {
Expand Down
1 change: 0 additions & 1 deletion src/components/SemesterView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@

<script>
import Vue from 'vue';
// import firebase from 'firebase';
import Course from '@/components/Course';
import Semester from '@/components/Semester';
import Confirmation from '@/components/Confirmation';
Expand Down
13 changes: 10 additions & 3 deletions src/firebaseConfig.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const firebase = require('firebase');
const firebase = require('firebase/app');
require('firebase/auth');
require('firebase/firestore');

// firebase init goes here
const config = {
Expand Down Expand Up @@ -30,8 +32,13 @@ const userDataCollection = db.collection('userData');
const alphaWhitelistCollection = db.collection('alphaWhitelist');
const landingEmailsCollection = db.collection('landingEmails');


module.exports = {
// Temp: removed coursesCollection
db, auth, currentUser, usersCollection, userDataCollection, landingEmailsCollection, alphaWhitelistCollection
db,
auth,
currentUser,
usersCollection,
userDataCollection,
landingEmailsCollection,
alphaWhitelistCollection
};
2 changes: 1 addition & 1 deletion src/router/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Vue from 'vue';
import Router from 'vue-router';
import firebase from 'firebase';
import firebase from 'firebase/app';

import Login from '@/components/Login';
import Dashboard from '@/components/Dashboard';
Expand Down

0 comments on commit e1e3afd

Please sign in to comment.