Browse Source

fix(%): remove hard coded %

renovate/lint-staged-8.x
Jack Mallers 7 years ago
parent
commit
f921c5e7d2
  1. 2
      app/components/LndSyncing/LndSyncing.js
  2. 4
      app/main.dev.js
  3. 1
      app/reducers/lnd.js
  4. 2
      app/routes/app/components/App.js

2
app/components/LndSyncing/LndSyncing.js

@ -40,7 +40,7 @@ class LndSyncing extends Component {
<div className={styles.container}>
<h3>zap</h3>
<div className={styles.loading}>
{!fetchingBlockHeight && <h4>{1}%</h4>}
{!fetchingBlockHeight && <h4>{syncPercentage}%</h4>}
<div className={styles.spinner}>
</div>
<h1>syncing your lightning node to the blockchain</h1>

4
app/main.dev.js

@ -141,8 +141,8 @@ app.on('ready', async () => {
console.log(line)
// Pass current clock height progress to front end for loading state UX
if (line.includes('Difficulty retarget at block height')) {
const blockHeight = line.slice(line.indexOf('Difficulty retarget at block height') + 'Difficulty retarget at block height'.length).trim()
if (line.includes('Caught up to height')) {
const blockHeight = line.slice(line.indexOf('Caught up to height') + 'Caught up to height'.length).trim()
mainWindow.webContents.send('lndStdout', blockHeight)
}

1
app/reducers/lnd.js

@ -33,6 +33,7 @@ export const lndSynced = () => dispatch => {
// Receive IPC event for LND streaming a line
export const lndStdout = (event, lndBlockHeight) => dispatch => {
console.log('lndBlockHeight: ', lndBlockHeight)
dispatch({ type: RECEIVE_LINE, lndBlockHeight: lndBlockHeight.split(' ')[0].split(/(\r\n|\n|\r)/gm)[0] })
}

2
app/routes/app/components/App.js

@ -44,6 +44,8 @@ class App extends Component {
children
} = this.props
console.log('syncPercentage: ', syncPercentage)
if (lnd.syncing) {
return (
<LndSyncing

Loading…
Cancel
Save