mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-26 05:53:39 -04:00
Fixed components w/out changes sometimes showing up in the save level modal.
This commit is contained in:
parent
3bbdee583d
commit
30998ecbec
1 changed files with 2 additions and 2 deletions
|
@ -24,7 +24,7 @@ module.exports = class SaveLevelModal extends SaveVersionModal
|
|||
context = super(context)
|
||||
context.level = @level
|
||||
context.levelNeedsSave = @level.hasLocalChanges()
|
||||
context.modifiedComponents = _.filter @supermodel.getModels(LevelComponent), @shouldSaveEntity
|
||||
window.mc = context.modifiedComponents = _.filter @supermodel.getModels(LevelComponent), @shouldSaveEntity
|
||||
context.modifiedSystems = _.filter @supermodel.getModels(LevelSystem), @shouldSaveEntity
|
||||
context.hasChanges = (context.levelNeedsSave or context.modifiedComponents.length or context.modifiedSystems.length)
|
||||
@lastContext = context
|
||||
|
@ -47,7 +47,7 @@ module.exports = class SaveLevelModal extends SaveVersionModal
|
|||
|
||||
shouldSaveEntity: (m) ->
|
||||
return false unless m.hasWriteAccess()
|
||||
return true if m.hasLocalChanges()
|
||||
return false unless m.hasLocalChanges()
|
||||
return true if (m.get('version').major is 0 and m.get('version').minor is 0) or not m.isPublished() and not m.collection
|
||||
# Sometimes we have two versions: one in a search collection and one with a URL. We only save changes to the latter.
|
||||
false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue