make the loading pokemon more predictable

This commit is contained in:
Jeff Colombo 2019-05-02 19:41:37 -04:00
parent 4b43415d06
commit 7b2fcc4b6a
2 changed files with 3 additions and 2 deletions

2
dist/main-bundle.js vendored

File diff suppressed because one or more lines are too long

View File

@ -26,7 +26,8 @@ export class Loading extends React.Component<ILoadingProps> {
'sprite',
);
const groupIndex = Math.floor(Math.random() * pokemonGroups.length);
// get the last digit of the timestamp and translate it to an index of pokemonGroups
const groupIndex = Math.floor(((Math.floor(+new Date() / 10000) % 10) / 10) * pokemonGroups.length);
const pokemonIcons = pokemonGroups[groupIndex].map((dex) => {
const pokemonCss = classNames(
pokemonIconCss,