|
@ -28,7 +28,11 @@ export default class ScoreRepo { |
|
|
getHighScores = () => { |
|
|
getHighScores = () => { |
|
|
let score = this.realmDB.objects(ScoreEntity.name).sorted('value', true); |
|
|
let score = this.realmDB.objects(ScoreEntity.name).sorted('value', true); |
|
|
let highScores = []; |
|
|
let highScores = []; |
|
|
|
|
|
let i = 0; |
|
|
score.forEach((row) => { |
|
|
score.forEach((row) => { |
|
|
|
|
|
if (i > 99){ |
|
|
|
|
|
return highScores; |
|
|
|
|
|
} |
|
|
highScores.push({user: row.user, value: row.value}); |
|
|
highScores.push({user: row.user, value: row.value}); |
|
|
}); |
|
|
}); |
|
|
return highScores; |
|
|
return highScores; |
|
|