chore(uuid): replace generateRandonString with uuid
This commit is contained in:
parent
025d9d0e9e
commit
7f8b41aba8
|
@ -1,7 +0,0 @@
|
||||||
// @flow
|
|
||||||
export const generateRandomString = () => Math.random()
|
|
||||||
.toString(36)
|
|
||||||
.substring(2, 15)
|
|
||||||
+ Math.random()
|
|
||||||
.toString(36)
|
|
||||||
.substring(2, 15);
|
|
|
@ -4,7 +4,7 @@ import React, { Component, Fragment } from 'react';
|
||||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||||
import { ipcRenderer } from 'electron';
|
import { ipcRenderer } from 'electron';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import { generateRandomString } from '../utils/generate-random-string';
|
import uuid from 'uuid/v4';
|
||||||
import { TextComponent } from '../components/text';
|
import { TextComponent } from '../components/text';
|
||||||
|
|
||||||
import ConsoleSymbol from '../assets/images/console_zcash.png';
|
import ConsoleSymbol from '../assets/images/console_zcash.png';
|
||||||
|
@ -82,7 +82,7 @@ export class ConsoleView extends Component<Props, State> {
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<ConsoleImg src={ConsoleSymbol} alt='Zcashd' />
|
<ConsoleImg src={ConsoleSymbol} alt='Zcashd' />
|
||||||
{log.split('\n').map((item, idx) => (
|
{log.split('\n').map((item, idx) => (
|
||||||
<Fragment key={generateRandomString()}>
|
<Fragment key={uuid()}>
|
||||||
<ConsoleText value={item} />
|
<ConsoleText value={item} />
|
||||||
{breakpoints.includes(idx) ? <br /> : null}
|
{breakpoints.includes(idx) ? <br /> : null}
|
||||||
</Fragment>
|
</Fragment>
|
||||||
|
|
|
@ -7,6 +7,7 @@ import processExists from 'process-exists';
|
||||||
import isDev from 'electron-is-dev';
|
import isDev from 'electron-is-dev';
|
||||||
import type { ChildProcess } from 'child_process';
|
import type { ChildProcess } from 'child_process';
|
||||||
import eres from 'eres';
|
import eres from 'eres';
|
||||||
|
import uuid from 'uuid/v4';
|
||||||
/* eslint-disable-next-line import/named */
|
/* eslint-disable-next-line import/named */
|
||||||
import { mainWindow } from '../electron';
|
import { mainWindow } from '../electron';
|
||||||
|
|
||||||
|
@ -16,7 +17,6 @@ import getDaemonName from './get-daemon-name';
|
||||||
import fetchParams from './run-fetch-params';
|
import fetchParams from './run-fetch-params';
|
||||||
import log from './logger';
|
import log from './logger';
|
||||||
import store from '../electron-store';
|
import store from '../electron-store';
|
||||||
import { generateRandomString } from '../../app/utils/generate-random-string';
|
|
||||||
|
|
||||||
const getDaemonOptions = ({ username, password }) => {
|
const getDaemonOptions = ({ username, password }) => {
|
||||||
/*
|
/*
|
||||||
|
@ -71,8 +71,8 @@ const runDaemon: () => Promise<?ChildProcess> = () => new Promise(async (resolve
|
||||||
password: store.get('rpcpassword'),
|
password: store.get('rpcpassword'),
|
||||||
}
|
}
|
||||||
: {
|
: {
|
||||||
username: generateRandomString(),
|
username: uuid(),
|
||||||
password: generateRandomString(),
|
password: uuid(),
|
||||||
};
|
};
|
||||||
|
|
||||||
if (isDev) log('Rpc Credentials', rpcCredentials);
|
if (isDev) log('Rpc Credentials', rpcCredentials);
|
||||||
|
|
Loading…
Reference in New Issue