vivtony00 / teamform-seed

This project is an application skeleton. It is used for a HKUST Software Engineering Course (COMP3111/H) in Fall 2016/17. My goal: The project is not asking students to re-produce the sample project. We should encourage students to do something better than the TA.
https://course.cse.ust.hk/comp3111/teamform/
MIT License
0 stars 5 forks source link

multiple call of initalizeFirebase() lead to failure of unit testing #55

Open vivtony00 opened 7 years ago

vivtony00 commented 7 years ago
        Error: Firebase App named '[DEFAULT]' already exists.
            at Z (lib/firebase.js:49:331)
            at Object.initializeApp (lib/firebase.js:48:29)

will shown when multiple call of initalizeFirebase() any solution?

vivtony00 commented 7 years ago
var firebaseInitalized =false;
function initalizeFirebase() {
  // Initialize Firebase
  var config = {
    apiKey: "AIzaSyAquft9UUOycldBxHWyG2toWPEsUgbOW34",
    authDomain: "team-long-time-no-name.firebaseapp.com",
    databaseURL: "https://team-long-time-no-name.firebaseio.com",
    storageBucket: "team-long-time-no-name.appspot.com",
    messagingSenderId: "7595823211"
  };
  if(firebaseInitalized==false){
    firebase.initializeApp(config);
    firebaseInitalized=true;
  }
}

a variable was added to solve the problem in site.js any better solution ?

hmhv1222 commented 7 years ago

we can temporarily use this as it should work pretty well right?