mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-28 01:55:38 -05:00
Fix achievement loads never happening if you didn't earn any of them
This commit is contained in:
parent
9f0a843593
commit
b44714a60b
1 changed files with 3 additions and 1 deletions
|
@ -120,8 +120,10 @@ module.exports = class HeroVictoryModal extends ModalView
|
|||
@thangTypes[thangTypeOriginal] = @supermodel.loadModel(thangType, 'thang').model
|
||||
|
||||
@newEarnedAchievements = []
|
||||
hadOneCompleted = false
|
||||
for achievement in @achievements.models
|
||||
continue unless achievement.completed
|
||||
hadOneCompleted = true
|
||||
ea = new EarnedAchievement({
|
||||
collection: achievement.get('collection')
|
||||
triggeredBy: @session.id
|
||||
|
@ -137,7 +139,7 @@ module.exports = class HeroVictoryModal extends ModalView
|
|||
@updateSavingProgressStatus()
|
||||
me.fetch cache: false unless me.loading
|
||||
|
||||
@readyToContinue = true if not @achievements.models.length
|
||||
@readyToContinue = true unless hadOneCompleted
|
||||
|
||||
# have to use a something resource because addModelResource doesn't handle models being upserted/fetched via POST like we're doing here
|
||||
@newEarnedAchievementsResource = @supermodel.addSomethingResource('earned achievements') if @newEarnedAchievements.length
|
||||
|
|
Loading…
Reference in a new issue