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