B2G/gaia/apps/costcontrol/js/views/balance.js
// On top up timeout or incorrect code
On top up timeout or incorrect code
On top up timeout or incorrect code
function onTopUpErrors(errors) {
    debug('ERRORS:', errors);
    var mode;
    if (errors['TOPUP_TIMEOUT']) {
      errors['TOPUP_TIMEOUT'] = false;
      mode = 'topup_timeout';
    }
    if (errors['INCORRECT_TOPUP_CODE']) {
      errors['INCORRECT_TOPUP_CODE'] = false;
      mode = 'incorrect_code';
    }
    debug('Most important error: ', mode);
    if (mode) {
      setTopUpMode(mode);
      ConfigManager.setOption({errors: errors});
    }
  }
function onTopUpErrors ( errors ) { debug ( 'ERRORS:' , errors ) ; var mode ; if ( errors [ 'TOPUP_TIMEOUT' ] ) { errors [ 'TOPUP_TIMEOUT' ] = false ; mode = 'topup_timeout' ; } if ( errors [ 'INCORRECT_TOPUP_CODE' ] ) { errors [ 'INCORRECT_TOPUP_CODE' ] = false ; mode = 'incorrect_code' ; } debug ( 'Most important error: ' , mode ) ; if ( mode ) { setTopUpMode ( mode ) ; ConfigManager . setOption ( { errors : errors } ) ; } }
On top up timeout or incorrect code
On top up timeout or incorrect code
// XXX: Very important to call this only if something has changed. If not, // infinite events are triggered.