Cleaned up readyToRank logic a bit.
This commit is contained in:
parent
1cab83236c
commit
31119f402a
1 changed files with 6 additions and 9 deletions
|
@ -112,17 +112,14 @@ module.exports = class MyMatchesTabView extends CocoView
|
||||||
|
|
||||||
readyToRank: (session) ->
|
readyToRank: (session) ->
|
||||||
return false unless session?.get('levelID') # If it hasn't been denormalized, then it's not ready.
|
return false unless session?.get('levelID') # If it hasn't been denormalized, then it's not ready.
|
||||||
|
return false unless c1 = session.get('code')
|
||||||
c1 = session?.get('code')
|
return false unless team = session.get('team')
|
||||||
c2 = session?.get('submittedCode')
|
return true unless c2 = session.get('submittedCode')
|
||||||
team = session?.get('team')
|
thangSpellArr = (s.split("/") for s in session.get('teamSpells')[team])
|
||||||
thangSpellArr = (s.split("/") for s in session?.get('teamSpells')[team])
|
|
||||||
return false unless c1
|
|
||||||
|
|
||||||
for item in thangSpellArr
|
for item in thangSpellArr
|
||||||
thang = item[0]
|
thang = item[0]
|
||||||
spell = item[1]
|
spell = item[1]
|
||||||
return true if c1[thang][spell] isnt c2?[thang][spell]
|
return true if c1[thang][spell] isnt c2[thang][spell]
|
||||||
return false
|
return false
|
||||||
|
|
||||||
rankSession: (e) ->
|
rankSession: (e) ->
|
||||||
|
|
Reference in a new issue