<commit_before><template>
  <div>
    <access-my-wallet-container />
    <price-bar :v-if="online && tokens.length > 1" :tokens="tokens" />
    <faqs />
  </div>
</template>

<script>
import AccessMyWalletContainer from './containers/AccessMyWalletContainer';
import FaqsContainer from '@/containers/FaqsContainer';
import PriceBar from './components/PriceBar';
import { mapGetters } from 'vuex';

export default {
  name: 'AccessWalletLayout',
  components: {
    'access-my-wallet-container': AccessMyWalletContainer,
    faqs: FaqsContainer,
    'price-bar': PriceBar
  },
  data() {
    return {
      tokens: []
    };
  },
  computed: {
    ...mapGetters({
      online: 'online'
    })
  },
  async mounted() {
    if (this.online) {
      this.tokens = await this.getRates();
    }
  },
  methods: {
    async getRates() {
      this.tokens = [];
      const tokenNames = [
        'BTC',
        'ETH',
        'REP',
        'KNC',
        'OMG',
        'EOS',
        'XRP',
        'BCH',
        'LTC',
        'TRX',
        'NEO',
        'ETC',
        'QTUM',
        'ADA',
        'XMR',
        'QTUM',
        'SNT',
        'ELF'
      ];
      const rates = await fetch(
        'https://cryptorates.mewapi.io/ticker?filter=BTC,ETH,REP,KNC,OMG,EOS,XRP,BCH,LTC,TRX,NEO,ETC,QTUM,ADA,XMR,QTUM,SNT,ELF'
      )
        .then(res => {
          return res.json();
        })
        .catch(err => {
          return err;
        });
      return Object.keys(rates.data)
        .map(item => Object.assign(rates.data[item]))
        .sort((a, b) => {
          if (a.rank < b.rank) return -1;
          if (a.rank > b.rank) return 1;
          return 0;
        })
        .filter(item => {
          if (
            tokenNames.find(el => {
              return el === item.symbol;
            }) !== undefined
          ) {
            return item;
          }<commit_msg>fix pricebar rankings<commit_after><template>
  <div>
    <access-my-wallet-container />
    <price-bar :v-if="online && tokens.length > 1" :tokens="tokens" />
    <faqs />
  </div>
</template>

<script>
import AccessMyWalletContainer from './containers/AccessMyWalletContainer';
import FaqsContainer from '@/containers/FaqsContainer';
import PriceBar from './components/PriceBar';
import { mapGetters } from 'vuex';

export default {
  name: 'AccessWalletLayout',
  components: {
    'access-my-wallet-container': AccessMyWalletContainer,
    faqs: FaqsContainer,
    'price-bar': PriceBar
  },
  data() {
    return {
      tokens: []
    };
  },
  computed: {
    ...mapGetters({
      online: 'online'
    })
  },
  async mounted() {
    if (this.online) {
      this.tokens = await this.getRates();
    }
  },
  methods: {
    async getRates() {
      this.tokens = [];
      const tokenNames = [
        'BTC',
        'ETH',
        'REP',
        'KNC',
        'OMG',
        'EOS',
        'XRP',
        'BCH',
        'LTC',
        'TRX',
        'NEO',
        'ETC',
        'QTUM',
        'ADA',
        'XMR',
        'QTUM',
        'SNT',
        'ELF'
      ];
      const rates = await fetch(
        'https://cryptorates.mewapi.io/ticker?filter=' + tokenNames.join(',')
      )
        .then(res => {
          return res.json();
        })
        .catch(err => {
          return err;
        });
      return Object.keys(rates.data)
        .map(item => Object.assign(rates.data[item]))
        .sort((a, b) => {
          if (a.market_cap_rank < b.market_cap_rank) return -1;
          if (a.market_cap_rank > b.market_cap_rank) return 1;
          return 0;
        })
        .filter(item => {
          if (
            tokenNames.find(el => {
              return el === item.symbol;
            }) !== undefined
          ) {
            return item;
          }
{'fraction_non_alphanumeric': 0.1600633914421553, 'fraction_numerical': 0.0021130480718436345, 'mean_word_length': 1.6972934472934473, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 35, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7387181', 'n_tokens_mistral': 1278, 'n_tokens_neox': 1266, 'n_words': 233}