fix: remove "Waiting for logs..." from console view

This commit is contained in:
George Lima 2019-01-05 16:35:45 -03:00
parent 2130e6e810
commit 3f6a998fba
1 changed files with 22 additions and 14 deletions

View File

@ -34,6 +34,18 @@ const initialLog = `
In order to ensure you are adequately protecting your privacy when using Zcash, please see <https://z.cash/support/security/>.
`;
const defaultState = `
\n
Block height | 0
Connections | 0
Network solution rate | 0 Sol/s
You are currently not mining.
To enable mining, add 'gen=1' to your zcash.conf and restart.
Since starting this node 0 minutes, 0 seconds ago:
- You have validated 0 transactions!
`;
const breakpoints = [1, 4, 7, 10, 13];
type Props = {};
@ -44,7 +56,7 @@ type State = {
export class ConsoleView extends Component<Props, State> {
state = {
log: '',
log: initialLog + defaultState,
};
componentDidMount() {
@ -58,19 +70,15 @@ export class ConsoleView extends Component<Props, State> {
return (
<Wrapper>
{log ? (
<Fragment>
<ConsoleImg src={ConsoleSymbol} alt='Zcashd' />
{log.split('\n').map((item, idx) => (
<Fragment key={generateRandomString()}>
<ConsoleText value={item} />
{breakpoints.includes(idx) ? <br /> : null}
</Fragment>
))}
</Fragment>
) : (
<ConsoleText value='Waiting for daemon logs...' />
)}
<Fragment>
<ConsoleImg src={ConsoleSymbol} alt='Zcashd' />
{log.split('\n').map((item, idx) => (
<Fragment key={generateRandomString()}>
<ConsoleText value={item} />
{breakpoints.includes(idx) ? <br /> : null}
</Fragment>
))}
</Fragment>
</Wrapper>
);
}