From ca479aa06de269e6bfa5ff6c7fe39eb05cb6943b Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Wed, 3 Jul 2019 15:47:05 +0300 Subject: [PATCH] fix js style --- .../assets/js/pages/verification_form.js | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/apps/block_scout_web/assets/js/pages/verification_form.js b/apps/block_scout_web/assets/js/pages/verification_form.js index b749f24b64..535d353163 100644 --- a/apps/block_scout_web/assets/js/pages/verification_form.js +++ b/apps/block_scout_web/assets/js/pages/verification_form.js @@ -2,8 +2,7 @@ import $ from 'jquery' import _ from 'lodash' import URI from 'urijs' import humps from 'humps' -import numeral from 'numeral' -import socket, { subscribeChannel } from '../socket' +import { subscribeChannel } from '../socket' import { createStore, connectElements } from '../lib/redux_helpers.js' export const initialState = { @@ -25,14 +24,13 @@ export function reducer (state = initialState, action) { channelDisconnected: true }) } - case 'RECEIVED_VERIFICATION_RESULT': { - console.log(action.msg) - if (action.msg.verificationResult === "ok") { - return window.location.replace(window.location.href.split('/contract_verifications')[0] + '/contracts') + case 'RECEIVED_VERIFICATION_RESULT': { + if (action.msg.verificationResult === 'ok') { + return window.location.replace(window.location.href.split('/contract_verifications')[0] + '/contracts') } else { return Object.assign({}, state, { - newForm: action.msg.verificationResult - }) + newForm: action.msg.verificationResult + }) } } default: @@ -48,8 +46,8 @@ const elements = { }, '[data-page="contract-verification"]': { render ($el, state) { - if (state.newForm) { - return $el.replaceWith(state.newForm) + if (state.newForm) { + return $el.replaceWith(state.newForm) } } } @@ -74,7 +72,7 @@ if ($contractVerificationPage.length) { addressChannel.onError(() => store.dispatch({ type: 'CHANNEL_DISCONNECTED' })) - addressChannel.on("verification", (msg) => store.dispatch({ + addressChannel.on('verification', (msg) => store.dispatch({ type: 'RECEIVED_VERIFICATION_RESULT', msg: humps.camelizeKeys(msg) }))