Commit d9598d0eb73e9a34e87d4ed2755ab233e396bceb

Authored by Adhidarma Hadiwinoto
1 parent 38912181eb
Exists in master and in 1 other branch webadmin

Salah pakai count, harusnya length

Showing 1 changed file with 10 additions and 1 deletions Side-by-side Diff

  1 +/* eslint-disable no-console */
  2 +const DEBUG = !!process.env.DEBUG_KOMODO_CENTER_CP_EVO_MODEMS;
  3 +
1 4 const config = require('komodo-sdk/config');
2 5  
3 6 exports.modemsDictionary = (arrayOfModem) => {
... ... @@ -21,7 +24,13 @@ exports.outgoingModems = (arrayOfModem) => {
21 24  
22 25 exports.randomModem = (arrayOfModem) => {
23 26 const modems = this.outgoingModems(arrayOfModem);
24   - const modemCount = modems.count;
  27 +
  28 + if (DEBUG) {
  29 + console.log('DEBUG_MODEMS: Get random modems', {
  30 + haystack: modems,
  31 + });
  32 + }
  33 + const modemCount = modems.length;
25 34  
26 35 if (!modemCount) return null;
27 36