mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-26 14:03:28 -04:00
Made the SuperModel a little bit more clever about handling duplicate loaded models, hopefully fixed #1108.
This commit is contained in:
parent
98752159ca
commit
607a2a133f
2 changed files with 1 additions and 5 deletions
app/models
|
@ -121,6 +121,7 @@ module.exports = class SuperModel extends Backbone.Model
|
|||
if cachedModel
|
||||
clone = $.extend true, {}, model.attributes
|
||||
cachedModel.set(clone, {silent: true})
|
||||
console.debug "Updated cached model <#{cachedModel.get('name') or cachedModel.getURL()}> with new data"
|
||||
else
|
||||
@registerModel(model)
|
||||
collection
|
||||
|
|
|
@ -13,8 +13,6 @@ module.exports = class ThangType extends CocoModel
|
|||
initialize: ->
|
||||
super()
|
||||
@building = {}
|
||||
@setDefaults()
|
||||
@on 'sync', @setDefaults
|
||||
@spriteSheets = {}
|
||||
|
||||
## Testing memory clearing
|
||||
|
@ -24,9 +22,6 @@ module.exports = class ThangType extends CocoModel
|
|||
# @_previousAttributes.raw = null
|
||||
#setTimeout f, 40000
|
||||
|
||||
setDefaults: ->
|
||||
@resetRawData() unless @get('raw')
|
||||
|
||||
resetRawData: ->
|
||||
@set('raw', {shapes: {}, containers: {}, animations: {}})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue