diff --git a/vanilla-js/index.html b/vanilla-js/index.html index c715e9161..3446067da 100644 --- a/vanilla-js/index.html +++ b/vanilla-js/index.html @@ -352,6 +352,7 @@

+ diff --git a/vanilla-js/scripts/FriendlyEats.View.js b/vanilla-js/scripts/FriendlyEats.View.js index 0e66f6a13..cc5b2e764 100644 --- a/vanilla-js/scripts/FriendlyEats.View.js +++ b/vanilla-js/scripts/FriendlyEats.View.js @@ -517,3 +517,9 @@ FriendlyEats.prototype.replaceElement = function(parent, content) { FriendlyEats.prototype.rerender = function() { this.router.navigate(document.location.pathname + '?' + new Date().getTime()); }; + +FriendlyEats.prototype.initAppCheck = function() { + /* + TODO: Initialize and activate App Check + */ +}; diff --git a/vanilla-js/scripts/FriendlyEats.js b/vanilla-js/scripts/FriendlyEats.js index 7220c0f29..e5e8ac77e 100644 --- a/vanilla-js/scripts/FriendlyEats.js +++ b/vanilla-js/scripts/FriendlyEats.js @@ -19,6 +19,21 @@ * Initializes the FriendlyEats app. */ function FriendlyEats() { + const isLocalhost = Boolean( + window.location.hostname === 'localhost' || + // [::1] is the IPv6 localhost address. + window.location.hostname === '[::1]' || + // 127.0.0.1/8 is considered localhost for IPv4. + window.location.hostname.match( + /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/ + ) +); + if(isLocalhost) { + /* + TODO: Set up local debug token + */ + } + this.filters = { city: '', price: '', @@ -29,6 +44,8 @@ function FriendlyEats() { this.dialogs = {}; var that = this; + that.initAppCheck(); + firebase.auth().signInAnonymously().then(function() { that.initTemplates(); that.initRouter();