mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-20 03:35:51 +00:00
Consolidated directory handling, added warning to tutorial
This commit is contained in:
@@ -6,7 +6,7 @@ const { initialize, subscribe, saveSaltedSeed, loadSaltedSeed } = require('../li
|
||||
|
||||
const TESTNET_URL = "wss://s.altnet.rippletest.net:51233"
|
||||
|
||||
const WALLET_DIR = 'Wallet'
|
||||
const WALLET_DIR = '../Wallet'
|
||||
|
||||
const createWindow = () => {
|
||||
|
||||
@@ -27,7 +27,7 @@ const main = async () => {
|
||||
const appWindow = createWindow()
|
||||
|
||||
// Create Wallet directory in case it does not exist yet
|
||||
if (!fs.existsSync(WALLET_DIR)) {
|
||||
if (!fs.existsSync(path.join(__dirname, WALLET_DIR))) {
|
||||
fs.mkdirSync(path.join(__dirname, WALLET_DIR));
|
||||
}
|
||||
|
||||
@@ -40,9 +40,9 @@ const main = async () => {
|
||||
|
||||
ipcMain.on('password-entered', async (event, password) => {
|
||||
if (!fs.existsSync(path.join(__dirname, WALLET_DIR , 'seed.txt'))) {
|
||||
saveSaltedSeed('../' + WALLET_DIR, seed, password)
|
||||
saveSaltedSeed(WALLET_DIR, seed, password)
|
||||
} else {
|
||||
seed = loadSaltedSeed('../' + WALLET_DIR, password)
|
||||
seed = loadSaltedSeed(WALLET_DIR, password)
|
||||
}
|
||||
|
||||
const wallet = xrpl.Wallet.fromSeed(seed)
|
||||
|
||||
@@ -6,7 +6,7 @@ const { initialize, subscribe, saveSaltedSeed, loadSaltedSeed } = require('../li
|
||||
|
||||
const TESTNET_URL = "wss://s.altnet.rippletest.net:51233"
|
||||
|
||||
const WALLET_DIR = 'Wallet'
|
||||
const WALLET_DIR = '../Wallet'
|
||||
|
||||
const createWindow = () => {
|
||||
|
||||
@@ -26,8 +26,8 @@ const createWindow = () => {
|
||||
const main = async () => {
|
||||
const appWindow = createWindow()
|
||||
|
||||
if (!fs.existsSync(WALLET_DIR)) {
|
||||
// Create Wallet directory in case it does not exist yet
|
||||
// Create Wallet directory in case it does not exist yet
|
||||
if (!fs.existsSync(path.join(__dirname, WALLET_DIR))) {
|
||||
fs.mkdirSync(path.join(__dirname, WALLET_DIR));
|
||||
}
|
||||
|
||||
@@ -40,9 +40,9 @@ const main = async () => {
|
||||
|
||||
ipcMain.on('password-entered', async (event, password) => {
|
||||
if (!fs.existsSync(path.join(__dirname, WALLET_DIR , 'seed.txt'))) {
|
||||
saveSaltedSeed('../' + WALLET_DIR, seed, password)
|
||||
saveSaltedSeed(WALLET_DIR, seed, password)
|
||||
} else {
|
||||
seed = loadSaltedSeed('../' + WALLET_DIR, password)
|
||||
seed = loadSaltedSeed(WALLET_DIR, password)
|
||||
}
|
||||
|
||||
const wallet = xrpl.Wallet.fromSeed(seed)
|
||||
@@ -54,7 +54,6 @@ const main = async () => {
|
||||
await subscribe(client, wallet, appWindow)
|
||||
|
||||
await initialize(client, wallet, appWindow)
|
||||
|
||||
})
|
||||
|
||||
ipcMain.on('request-seed-change', (event) => {
|
||||
|
||||
@@ -7,7 +7,7 @@ const { sendXrp } = require('../library/7_helpers')
|
||||
|
||||
const TESTNET_URL = "wss://s.altnet.rippletest.net:51233"
|
||||
|
||||
const WALLET_DIR = 'Wallet'
|
||||
const WALLET_DIR = '../Wallet'
|
||||
|
||||
const createWindow = () => {
|
||||
|
||||
@@ -27,8 +27,8 @@ const createWindow = () => {
|
||||
const main = async () => {
|
||||
const appWindow = createWindow()
|
||||
|
||||
if (!fs.existsSync(WALLET_DIR)) {
|
||||
// Create Wallet directory in case it does not exist yet
|
||||
// Create Wallet directory in case it does not exist yet
|
||||
if (!fs.existsSync(path.join(__dirname, WALLET_DIR))) {
|
||||
fs.mkdirSync(path.join(__dirname, WALLET_DIR));
|
||||
}
|
||||
|
||||
@@ -41,9 +41,9 @@ const main = async () => {
|
||||
|
||||
ipcMain.on('password-entered', async (event, password) => {
|
||||
if (!fs.existsSync(path.join(__dirname, WALLET_DIR , 'seed.txt'))) {
|
||||
saveSaltedSeed('../' + WALLET_DIR, seed, password)
|
||||
saveSaltedSeed(WALLET_DIR, seed, password)
|
||||
} else {
|
||||
seed = loadSaltedSeed('../' + WALLET_DIR, password)
|
||||
seed = loadSaltedSeed(WALLET_DIR, password)
|
||||
}
|
||||
|
||||
const wallet = xrpl.Wallet.fromSeed(seed)
|
||||
|
||||
@@ -8,7 +8,7 @@ const { verify } = require('../library/8_helpers')
|
||||
|
||||
const TESTNET_URL = "wss://s.altnet.rippletest.net:51233"
|
||||
|
||||
const WALLET_DIR = 'Wallet'
|
||||
const WALLET_DIR = '../Wallet'
|
||||
|
||||
const createWindow = () => {
|
||||
|
||||
@@ -28,8 +28,8 @@ const createWindow = () => {
|
||||
const main = async () => {
|
||||
const appWindow = createWindow()
|
||||
|
||||
if (!fs.existsSync(WALLET_DIR)) {
|
||||
// Create Wallet directory in case it does not exist yet
|
||||
// Create Wallet directory in case it does not exist yet
|
||||
if (!fs.existsSync(path.join(__dirname, WALLET_DIR))) {
|
||||
fs.mkdirSync(path.join(__dirname, WALLET_DIR));
|
||||
}
|
||||
|
||||
@@ -42,9 +42,9 @@ const main = async () => {
|
||||
|
||||
ipcMain.on('password-entered', async (event, password) => {
|
||||
if (!fs.existsSync(path.join(__dirname, WALLET_DIR , 'seed.txt'))) {
|
||||
saveSaltedSeed('../' + WALLET_DIR, seed, password)
|
||||
saveSaltedSeed(WALLET_DIR, seed, password)
|
||||
} else {
|
||||
seed = loadSaltedSeed('../' + WALLET_DIR, password)
|
||||
seed = loadSaltedSeed(WALLET_DIR, password)
|
||||
}
|
||||
|
||||
const wallet = xrpl.Wallet.fromSeed(seed)
|
||||
|
||||
Reference in New Issue
Block a user