monkey-front-components 0.0.358 → 0.0.361

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2623,26 +2623,25 @@ class ProductsModel {
2623
2623
  const { product, token, url } = this;
2624
2624
  if (!url)
2625
2625
  return;
2626
- const contries = {
2627
- '.monkey.exchange': 'br',
2628
- '.monkeyecx.com': 'br',
2629
- '.sales.finance': 'br',
2630
- '.monkeyexchange.cl': 'cl'
2631
- };
2632
- const domain = url.substring(url.indexOf('.', -1), url.length);
2633
- const country = contries[domain];
2634
2626
  const sufix = {
2635
- SUPPLY_CHAIN: 'SCF',
2636
- SALES_FINANCE: 'SF'
2627
+ SALES_FINANCE: 'SF_',
2628
+ SPIKE: 'SF_',
2629
+ SUPPLY_CHAIN: 'SF_'
2637
2630
  }[product];
2638
- let handled = 'https://assets.monkey.exchange';
2639
- if (domain.includes('monkey.credit')) {
2640
- handled = `credit/wl/${token}/login.svg`;
2641
- }
2642
- else {
2643
- handled = `${sufix}/${country}/wl/${token}/login.svg`;
2644
- }
2645
- this.logo = `https://assets.monkey.exchange/${handled}`.toLowerCase();
2631
+ const { hostname } = new URL(url);
2632
+ const lastDot = hostname?.lastIndexOf('.');
2633
+ const previousLastDot = hostname?.lastIndexOf('.', lastDot - 1);
2634
+ const domain = hostname?.substring(previousLastDot + 1, hostname?.length);
2635
+ const handledToken = token?.replace(sufix, '');
2636
+ const path = {
2637
+ 'monkeyecx.com': 'scf/br',
2638
+ 'monkey.exchange': 'scf/br',
2639
+ 'monkeyexchange.cl': 'scf/cl',
2640
+ 'sales.finance': 'sf',
2641
+ 'spike.cash': 'spike',
2642
+ 'monkey.credit': 'credit'
2643
+ }[domain];
2644
+ this.logo = `https://assets.monkey.exchange/${path}/wl/${handledToken}/login.svg`.toLowerCase();
2646
2645
  }
2647
2646
  }
2648
2647