From 3863b800eb06cc3871c10589a36f56fb5ef6b857 Mon Sep 17 00:00:00 2001 From: George Lima Date: Fri, 7 Dec 2018 10:46:03 -0300 Subject: [PATCH] feature: load rpc credentials from store --- services/api.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/services/api.js b/services/api.js index 0468184..259f337 100644 --- a/services/api.js +++ b/services/api.js @@ -1,14 +1,16 @@ // @flow import got from 'got'; +/* eslint-disable-next-line */ +import isDev from 'electron-is-dev'; import { METHODS, type APIMethods } from './utils'; +import store from '../config/electron-store'; -// TODO: Fix RPC connect params const RPC = { - host: 'localhost', - port: 8232, - user: 'george', - password: '123456', + host: '127.0.0.1', + port: isDev ? 18232 : 8232, + user: store.get('rpcuser'), + password: store.get('rpcpassword'), }; const client = got.extend({