1
0
mirror of https://gitlab.com/Deukhoofd/BattleSim.git synced 2025-10-27 18:00:03 +00:00

Resolved extreme lag on logging in for Owners, added Owner button to retrieve all teams on the server

This commit is contained in:
Deukhoofd
2016-02-28 17:06:27 +01:00
parent a7ee5c24ab
commit f737f48545
7 changed files with 38 additions and 14 deletions

View File

@@ -235,9 +235,10 @@ CLIENT_VERSION = assets.getVersion()
.save().then (team) ->
callback(team.id)
spark.on 'requestTeams', ->
spark.on 'requestTeams', (fetchall = false) ->
console.log(fetchall)
q = new database.Teams()
if user.authority != auth.levels.OWNER
if !(fetchall && user.authority == auth.levels.OWNER)
q = q.query('where', trainer_id: user.id)
q = q.query('orderBy', 'created_at')
.fetch()