Remove dead code

This commit is contained in:
Aditya Kulkarni 2020-03-12 12:55:32 -07:00
parent 0c617d0476
commit 9fa477b070
2 changed files with 0 additions and 51 deletions

View File

@ -1,50 +0,0 @@
import os from 'os';
import path from 'path';
import fs from 'fs';
import { remote } from 'electron';
import { Transaction, TxDetail } from '../components/AppState';
export default class SentTxStore {
static locateSentTxStore() {
if (os.platform() === 'darwin') {
return path.join(remote.app.getPath('appData'), 'Zcash', 'senttxstore.dat');
}
if (os.platform() === 'linux') {
return path.join(
remote.app.getPath('home'),
'.local',
'share',
'zec-qt-wallet-org',
'zec-qt-wallet',
'senttxstore.dat'
);
}
return path.join(remote.app.getPath('appData'), 'Zcash', 'senttxstore.dat');
}
static async loadSentTxns(): Transaction[] {
try {
const sentTx = JSON.parse(await fs.promises.readFile(SentTxStore.locateSentTxStore()));
return sentTx.map(s => {
const transction = new Transaction();
transction.type = s.type;
transction.amount = s.amount;
transction.address = s.from;
transction.txid = s.txid;
transction.time = s.datetime;
transction.detailedTxns = [new TxDetail()];
transction.detailedTxns[0].address = s.address;
transction.detailedTxns[0].amount = s.amount;
transction.detailedTxns[0].memo = s.memo;
return transction;
});
} catch (err) {
// If error for whatever reason (most likely, file not found), just return an empty array
return [];
}
}
}

View File

@ -297,7 +297,6 @@
"react-modal": "^3.11.1", "react-modal": "^3.11.1",
"react-router": "^5.1.2", "react-router": "^5.1.2",
"react-router-dom": "^5.1.2", "react-router-dom": "^5.1.2",
"react-select": "^3.0.8",
"react-tabs": "^3.1.0", "react-tabs": "^3.1.0",
"react-textarea-autosize": "^7.1.2", "react-textarea-autosize": "^7.1.2",
"source-map-support": "^0.5.16", "source-map-support": "^0.5.16",