Server now thinks it's production whenever it's not localhost:3000, rather than whenever it is codecombat.com.

This commit is contained in:
Nick Winter 2015-03-01 22:19:01 -08:00
parent 7de6fcf5fd
commit bb80db9cd5
3 changed files with 3 additions and 3 deletions

View file

@ -45,7 +45,7 @@ console.debug ?= console.log # Needed for IE10 and earlier
Application = initialize: ->
Router = require('core/Router')
@isProduction = -> document.location.href.search('codecombat.com') isnt -1
@isProduction = -> document.location.href.search('https?://localhost:3000') is -1
@isIPadApp = webkit?.messageHandlers? and navigator.userAgent?.indexOf('iPad') isnt -1
$('body').addClass 'ipad' if @isIPadApp
@tracker = new Tracker()

View file

@ -29,7 +29,7 @@ module.exports = class LevelBus extends Bus
constructor: ->
super(arguments...)
@changedSessionProperties = {}
if document.location.href.search('codecombat.com') isnt -1
if application.isProduction()
@saveSession = _.debounce(@reallySaveSession, 4000, {maxWait: 10000}) # Save slower on production.
else
@saveSession = _.debounce(@reallySaveSession, 1000, {maxWait: 5000}) # Save quickly in development.

View file

@ -121,7 +121,7 @@ module.exports = class CocoView extends Backbone.View
getRenderData: (context) ->
context ?= {}
context.isProduction = document.location.href.search(/codecombat.com/) isnt -1
context.isProduction = application.isProduction()
context.me = me
context.pathname = document.location.pathname # like '/play/level'
context.fbRef = context.pathname.replace(/[^a-zA-Z0-9+/=\-.:_]/g, '').slice(0, 40) or 'home'