Sha256: ed4606409f630f0e0756d714c021042216e005ef8b2a15211c5a0ff1a128aa1b
Contents?: true
Size: 1.19 KB
Versions: 2
Compression:
Stored size: 1.19 KB
Contents
--- layout: null --- firebaseAuthAccountApp = function() { firebase.auth().onAuthStateChanged(function(user) { if (user) { // User is signed in. user.getIdToken().then(function(accessToken) { setSidenavHeaderData(user); let photoURL = 'https://www.gravatar.com/avatar/' + md5(user.email) + '?s=70&d=identicon'; firebase.auth().currentUser.updateProfile({ 'photoURL': photoURL }); }); } else { // User is signed out. window.location.href = "/login/?mode=select&signInSuccessUrl=/account/"; } }, function(error) { console.log(error); }); }; firestoreAccountApp = function() { const docRef = firestoredb.doc("exchange-rates/usd"); const usdSell = document.querySelector("#sell-usd-exchange-rates2"); const usdUpdatedAt = document.querySelector("#updated-at-usd-exchange-rates2"); docRef.onSnapshot(function (doc){ if (doc && doc.exists) { const data = doc.data(); usdSell.innerText = "USD: " + data.sell.toFixed(2); usdUpdatedAt.innerText = parseDate(new Date(data.updated_at)); } }); } window.addEventListener('load', function() { firebaseAuthAccountApp() }); firestoreAccountApp();
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
jekyll-theme-marketing-1.0.1 | assets/js/firebase/firebase-account-controller.js |
jekyll-theme-marketing-1.0.0 | assets/js/firebase/firebase-account-controller.js |