src/store/index.js
// default handler called for all methods
default handler called for all methods
default handler called for all methods
SOCKET_ONMESSAGE (state, message) {
      var self = this
      state.socket.message = message
      let data = message
      let type = data.symbol
      let bchObj = state.walletModule.bch || []
      let whcObj = state.walletModule.whc || {}
      switch (type) {
        case 'BCH':
          let index = bchObj.findIndex(bchItem => {
            return bchItem.address === data.address
          })
          if (index > -1) {
            bchObj[index].confirmed = data.balance.confirmed
            bchObj[index].unconfirmed = data.balance.unconfirmed
          }
          self.dispatch('wallet_set_bch', bchObj, { root: true })
          break
        case 'Wormhole':
          whcObj[data.address] = data.balance
          self.dispatch('set_wallet_whc', whcObj, { root: true })
          break
      }
    }
SOCKET_ONMESSAGE ( state , message ) { var self = this state . socket . message = message let data = message let type = data . symbol let bchObj = state . walletModule . bch || [ ] let whcObj = state . walletModule . whc || { } switch ( type ) { case 'BCH' : let index = bchObj . findIndex ( bchItem => { return bchItem . address === data . address } ) if ( index > - 1 ) { bchObj [ index ] . confirmed = data . balance . confirmed bchObj [ index ] . unconfirmed = data . balance . unconfirmed } self . dispatch ( 'wallet_set_bch' , bchObj , { root : true } ) break case 'Wormhole' : whcObj [ data . address ] = data . balance self . dispatch ( 'set_wallet_whc' , whcObj , { root : true } ) break } }
default handler called for all methods
default handler called for all methods