Skip to content

Commit

Permalink
Correctly join data paths and fix issue 11
Browse files Browse the repository at this point in the history
  • Loading branch information
whphhg committed May 24, 2017
1 parent 53dc984 commit 433da57
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ and the second part by using the `ISO 3166 Alpha-2 code`
the two with a dash `-`.

After you've created the correctly named translation directory, open
`src/stores/gui.js` and add the new translation to the `languages` array (in
alphabetical order).
`src/stores/gui.js` and add the new translation to the
[languages](https://github.com/whphhg/vcash-electron/blob/master/src/stores/gui.js#L20-L24)
array (in alphabetical order).

{ language: 'languageCode-countryCode', name: 'New language' },

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vcash-electron",
"productName": "Vcash Electron GUI",
"version": "0.31.4",
"version": "0.31.5",
"description": "Multi-platform and multi-node GUI for Vcash.",
"main": "src/electron.js",
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions src/components/WalletBackup.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { action, computed, observable } from 'mobx'
import { inject, observer } from 'mobx-react'
import { Button, Input, message } from 'antd'
import { remote } from 'electron'
import { sep } from 'path'
import { join, sep } from 'path'
import { dataPath } from '../utilities/common'

/** Load translation namespaces and delay rendering until they are loaded. */
Expand All @@ -23,7 +23,7 @@ export default class WalletBackup extends React.Component {
this.rpc = props.rpc
this.path = this.rpc.connection.status.tunnel === true
? ''
: dataPath()
: join(dataPath(), 'backups', sep)
}

/**
Expand Down Expand Up @@ -57,7 +57,7 @@ export default class WalletBackup extends React.Component {

/** Set selected path. */
if (typeof selected !== 'undefined') {
this.path = selected[0] + sep
this.path = join(selected[0], sep)
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/utilities/common.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { homedir } from 'os'
import { sep } from 'path'
import { join, sep } from 'path'

/** Required store instances. */
import gui from '../stores/gui'
Expand All @@ -22,13 +22,13 @@ export const decimalSeparator = () => {
export const dataPath = () => {
switch (process.platform) {
case 'darwin':
return homedir() + '/Library/Application Support/Vcash/data' + sep
return join(homedir(), 'Library', 'Application Support', 'Vcash', sep)

case 'win32':
return homedir() + '/%APPDATA%/Vcash/data' + sep
return join(homedir(), 'AppData', 'Roaming', 'Vcash', sep)

default:
return homedir() + '/.Vcash/data' + sep
return join(homedir(), '.Vcash', 'data', sep)
}
}

Expand Down

0 comments on commit 433da57

Please sign in to comment.