mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-25 20:30:01 -04:00
I think this fixes #976. I believe the client was attempting to save components and systems it didn't have write access to, and that was gumming up the works. Not 100% sure though; reopen if it rears its ugly head once more.
This commit is contained in:
parent
3d51969757
commit
0292be054e
1 changed files with 2 additions and 0 deletions
|
@ -35,6 +35,7 @@ module.exports = class LevelSaveView extends SaveVersionModal
|
||||||
models = if @lastContext.levelNeedsSave then [@level] else []
|
models = if @lastContext.levelNeedsSave then [@level] else []
|
||||||
models = models.concat @lastContext.modifiedComponents
|
models = models.concat @lastContext.modifiedComponents
|
||||||
models = models.concat @lastContext.modifiedSystems
|
models = models.concat @lastContext.modifiedSystems
|
||||||
|
models = (m for m in models when m.hasWriteAccess())
|
||||||
for changeEl, i in changeEls
|
for changeEl, i in changeEls
|
||||||
model = models[i]
|
model = models[i]
|
||||||
try
|
try
|
||||||
|
@ -44,6 +45,7 @@ module.exports = class LevelSaveView extends SaveVersionModal
|
||||||
console.error "Couldn't create delta view:", e
|
console.error "Couldn't create delta view:", e
|
||||||
|
|
||||||
shouldSaveEntity: (m) ->
|
shouldSaveEntity: (m) ->
|
||||||
|
return false unless m.hasWriteAccess()
|
||||||
return true if m.hasLocalChanges()
|
return true if 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
|
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.
|
# Sometimes we have two versions: one in a search collection and one with a URL. We only save changes to the latter.
|
||||||
|
|
Loading…
Add table
Reference in a new issue