File tree 1 file changed +3
-4
lines changed
1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ export const pages: Chat.PageTable = {
129
129
let speciesID = query . shift ( ) ;
130
130
let buf ;
131
131
if ( speciesID ) {
132
- speciesID = getLevelSpeciesID ( { species : query . shift ( ) || '' } as PokemonSet ) ;
132
+ speciesID = getLevelSpeciesID ( { species : speciesID || '' } as PokemonSet ) ;
133
133
const species = Dex . species . get ( speciesID ) ;
134
134
if ( ! species . exists ||
135
135
species . isNonstandard || species . isNonstandard === 'Unobtainable' ||
@@ -148,14 +148,13 @@ export const pages: Chat.PageTable = {
148
148
this . title = `[History] [Gen 9] Computer Generated Teams` ;
149
149
150
150
const MAX_LINES = 100 ;
151
- let lines = 0 ;
152
151
buf += `<div class="ladder pad"><table><tr><th>Pokemon</th><th>Level</th><th>Timestamp</th>` ;
153
- for ( const entry of history ) {
152
+ for ( let i = history . length - 1 ; history . length - i <= MAX_LINES ; i -- ) {
153
+ const entry = history [ i ] ;
154
154
if ( speciesID && entry . species_id !== speciesID ) continue ;
155
155
buf += `<tr><td>${ entry . species_id } </td><td>${ entry . level } </td>` ;
156
156
const timestamp = new Date ( entry . timestamp ) ;
157
157
buf += `<td>${ timestamp . toLocaleDateString ( ) } , ${ timestamp . toLocaleTimeString ( ) } </td></tr>` ;
158
- if ( ++ lines >= MAX_LINES ) break ;
159
158
}
160
159
buf += `</table></div></div>` ;
161
160
return buf ;
You can’t perform that action at this time.
0 commit comments