Skip to content

Commit

Permalink
💄 getting house from firebase based on uid
Browse files Browse the repository at this point in the history
  • Loading branch information
josephv7 committed Oct 28, 2018
1 parent 5a5ab6f commit ea4f5d5
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 28 deletions.
22 changes: 11 additions & 11 deletions .firebase/hosting.ZGlzdA.cache
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
c6f0da4e970865ec10c7.bundle.js,1540747776735,9fd34a2076082b267a85be05074d8253d0c220fa11f4e0c01854978e8e42ba7d
c6f0da4e970865ec10c7.bundle.js.map,1540747776736,c19e85fdbe15197e610e714c356a6ffb4e3459fa4a195c0a362c7d3c489c0043
login.css,1540747776735,b08b1b0d5f41384bb1a8b5318aa99e9a8394a0c49d37fb7cf115f33abe860556
main.css,1540747776736,46afdea36a7b50d9215e2e71c835aed7ddad9039f5f42f722038ab92b1ac2be8
precache-manifest.7319035f251d7cdf269072e0ddfc360a.js,1540747776736,b86f8392cada566b6c14e2778255225b9296f0b7f26ef05ae8511e403489fea9
login.html,1540747776736,9da5335d105c4a3a9fb5361a75664f680fbd1819a6a2e01fae276ccd5bc15cb1
registration.css,1540747776736,1ec68dd1a1bc4e25685a8fea335c13a50ecea903056bb152925ff48736fb44dd
index.html,1540747776736,60e9af23b23edd3871812eeb083a842b92ca11b8ff5d79e957c0efff06c16084
sw.js,1540747776736,a5a264c199fef817dcbc6f3bb6d72eed5418a22775b4c1c62abdd6c5263b165b
registration.html,1540747776736,607ef06433b4a2e52385c7717682dcf6f475295b45221df9e6728f5d5c9fab79
sketch.js,1540747838930,e47e7727c3f6482b86f7c925c36328764661f4be214e0f516a88d4690619c27e
83682df64894ae8d103a.bundle.js,1540754051807,9e3eb750813de7b86ac46c1bdfc041e4dee4b83503ca026eb5b44da3c66fc1b0
83682df64894ae8d103a.bundle.js.map,1540754051806,c9003510ac495db0bb3b2ca7ff950cc155b693c92eecc2de379f79fc01963b57
login.css,1540754051806,b08b1b0d5f41384bb1a8b5318aa99e9a8394a0c49d37fb7cf115f33abe860556
main.css,1540754051807,46afdea36a7b50d9215e2e71c835aed7ddad9039f5f42f722038ab92b1ac2be8
login.html,1540754051806,8e48bd69f6cddeea849a51165bbedd955507476054f3339528a1125b371e0470
precache-manifest.9a02a9c2a3720181970d88ec7d71a67e.js,1540754051807,53531ebf6087ae885055722a7100f72a9ebb5d423db681caaa8a6a0e3e6ac5ff
registration.css,1540754051807,1ec68dd1a1bc4e25685a8fea335c13a50ecea903056bb152925ff48736fb44dd
index.html,1540754051806,63cdeba2843a3cd51bd8455fa1d1cd77c2abc5d7f0c5f32f35049e89f38c6f32
sw.js,1540754051807,a2a9923b915cf3b8f70c50ca48484bcfec7cc44eeef0913a79cde5b331386195
registration.html,1540754051806,4b4ff1a0a3635e86fd1a61d318b79a221919cccc8a8d77237889bda672458d49
sketch.js,1540754056905,e47e7727c3f6482b86f7c925c36328764661f4be214e0f516a88d4690619c27e
51 changes: 34 additions & 17 deletions src/registration.html
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,39 @@ <h2 style="font-family: 'Titillium Web', bold;font-weight: 300; text-align:cente
});
});


var ref = firebase.database.ref();
var user = firebase.auth().currentUser;
var uid = user.uid;
ref.child('reg_captains').child(uid).on("value", function(snapshot) {
var house = snapshot.val();
console.log(val);
}
var house, uid;
firebase.auth().onAuthStateChanged(function(user) {
if (user) {
uid = firebase.auth().currentUser.uid;
console.log(uid);
console.log('here2');

firebase.database().ref().child('reg_captains').once("value",function(snapshot){
console.log('here');
var house = snapshot.child(uid).val();
console.log(house);
})

} else {
// No user is signed in.

}
});

// var uid = firebase.auth().currentUser.uid;
// console.log(uid);
// var ref = firebase.database().ref();
// var user = firebase.auth().currentUser;
// if(user){
// // uid = user.uid;
// }else{
// //nothing
// }

// ref.child('reg_captains').on("value", function(snapshot) {
// var house = snapshot.child(uid).val();
// console.log(house);
// });



Expand All @@ -146,15 +171,7 @@ <h2 style="font-family: 'Titillium Web', bold;font-weight: 300; text-align:cente



// firebase.auth().onAuthStateChanged(function(user) {
// if (user) {
// // User is signed in
// window.location.href = "registration.html";
// } else {
// // No user is signed in.
// console.log("No One");
// }
// });




Expand Down

0 comments on commit ea4f5d5

Please sign in to comment.