Simple fix for a race condition where the user schema might load after /auth/whoami, overwriting /auth/whoami's cookie.

This commit is contained in:
Scott Erickson 2014-03-08 13:06:04 -08:00
parent 2fa40fb2db
commit 2861f62248

View file

@ -22,7 +22,8 @@ class CocoModel extends Backbone.Model
if @constructor.schema?.loaded
@addSchemaDefaults()
else
@loadSchema()
{me} = require 'lib/auth'
@loadSchema() if me?.loaded
@once 'sync', @onLoaded, @
@saveBackup = _.debounce(@saveBackup, 500)