From 0c74ca735e4daa8150fca7aa8a34b73475fb1e53 Mon Sep 17 00:00:00 2001 From: Ilya Vilensky Date: Mon, 30 Mar 2020 19:59:30 +0300 Subject: [PATCH] Fixed rewards display issue. Regression cause by other bug fix (#467) --- app/infra/utils.js | 2 +- desktop/nodeManager.js | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/app/infra/utils.js b/app/infra/utils.js index 1110f9ba2..21d432790 100644 --- a/app/infra/utils.js +++ b/app/infra/utils.js @@ -16,7 +16,7 @@ const createError = (message, func) => ({ const getAbbreviatedText = (address: string, addPrefix: boolean = true, tailSize: number = 4) => `${addPrefix && address.indexOf('0x') === -1 ? '0x' : ''}${address.substring(0, tailSize)}...${address.substring(address.length - tailSize, address.length)}`; -const formatTxId = (id) => id && id.substring(0, 6); +const formatTxId = (id) => id && `0x${id.substring(0, 6)}`; const formatNumber = (num) => num.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1,'); diff --git a/desktop/nodeManager.js b/desktop/nodeManager.js index 107065019..78fde9112 100644 --- a/desktop/nodeManager.js +++ b/desktop/nodeManager.js @@ -53,18 +53,16 @@ class NodeManager { os.type() === 'Windows_NT' ? `(if exist ${nodeDataFilesPath} rd /s /q ${nodeDataFilesPath}) && (if exist ${logFilePath} del ${logFilePath})` : `rm -rf ${nodeDataFilesPath} && rm -rf ${logFilePath}`; - exec(command, (err) => { + exec(command, async (err) => { if (!err) { + StoreService.set({ key: 'genesisTime', value: fetchedGenesisTime }); + StoreService.remove({ key: 'miningParams' }); + await FileSystemManager.cleanWalletFile(); const nodePathWithParams = `"${nodePath}" --grpc-server --json-server --tcp-port ${port} --config "${tomlFileLocation}" -d "${nodeDataFilesPath}" > "${logFilePath}"`; - exec(nodePathWithParams, async (error) => { + exec(nodePathWithParams, (error) => { if (error) { (process.env.NODE_ENV !== 'production' || process.env.DEBUG_PROD === 'true') && dialog.showErrorBox('Smesher Start Error', `${error}`); console.error(error); // eslint-disable-line no-console - } else { - StoreService.set({ key: 'genesisTime', value: fetchedGenesisTime }); - StoreService.remove({ key: 'miningParams' }); - await FileSystemManager.cleanWalletFile(); - console.log('node started with provided params'); // eslint-disable-line no-console } }); } else {