Browse Source

Merge pull request #57 from loeck/master

Move i18n in static directory, set getAsyncAddress to 0 when you add …
master
Meriadec Pillet 7 years ago
committed by GitHub
parent
commit
45468e7636
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      .gitignore
  2. 6
      package.json
  3. 8
      src/components/UpdateNotifier.js
  4. 2
      src/constants.js
  5. 4
      src/helpers/btc.js
  6. 2
      src/internals/usb/wallet/accounts.js
  7. 2
      src/renderer/i18n.js
  8. 0
      static/i18n/en/translation.yml
  9. 0
      static/i18n/fr/translation.yml
  10. 26
      yarn.lock

3
.gitignore

@ -1,9 +1,8 @@
.DS_Store
*.log
/.env
/dist/
/flow-typed/
/node_modules/
/static/
/storybook-static/
thumbs.db
/.env

6
package.json

@ -76,7 +76,7 @@
"redux-actions": "^2.2.1",
"redux-thunk": "^2.2.0",
"shortid": "^2.2.8",
"source-map-support": "^0.5.2",
"source-map-support": "^0.5.3",
"styled-components": "^3.0.2",
"styled-system": "^1.1.1"
},
@ -108,11 +108,11 @@
"eslint-plugin-flowtype": "^2.42.0",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "^7.5.1",
"eslint-plugin-react": "^7.6.0",
"flow-bin": "^0.64.0",
"flow-typed": "^2.2.3",
"husky": "^0.14.3",
"lint-staged": "^6.0.0",
"lint-staged": "^6.1.0",
"node-loader": "^0.6.0",
"prettier": "^1.10.2",
"react-hot-loader": "^4.0.0-beta.17",

8
src/components/UpdateNotifier.js

@ -7,7 +7,7 @@ import type { MapStateToProps } from 'react-redux'
import styled from 'styled-components'
import { getUpdateStatus, getUpdateData } from 'reducers/update'
import { sendEvent, checkUpdates } from 'renderer/events'
import { sendEvent } from 'renderer/events'
import type { State } from 'reducers'
import type { UpdateStatus } from 'reducers/update'
@ -39,12 +39,6 @@ const Container = styled(Box).attrs({
`
class UpdateNotifier extends PureComponent<Props> {
componentWillReceiveProps(nextProps) {
if (['idle', 'unavailable', 'error'].includes(nextProps.updateStatus)) {
checkUpdates()
}
}
renderStatus() {
const { updateStatus } = this.props
switch (updateStatus) {

2
src/constants.js

@ -1,2 +1,2 @@
export const CHECK_UPDATE_TIMEOUT = 5e3
export const SYNC_ACCOUNT_TIMEOUT = 5e3
export const SYNC_ACCOUNT_TIMEOUT = 2e3

4
src/helpers/btc.js

@ -60,12 +60,14 @@ export async function getAccount({
hdnode,
segwit,
network,
asyncDelay = 100,
}: {
allAddresses?: Array<string>,
currentIndex?: number,
hdnode: Object,
segwit: boolean,
network: Object,
asyncDelay?: number,
}) {
const gapLimit = 20
const script = segwit ? parseInt(network.scriptHash, 10) : parseInt(network.pubKeyHash, 10)
@ -99,7 +101,7 @@ export async function getAccount({
})
const getAsyncAddress = params =>
new Promise(resolve => setTimeout(() => resolve(getAddress(params)), 100))
new Promise(resolve => setTimeout(() => resolve(getAddress(params)), asyncDelay))
const getLastAddress = (addresses, txs) => {
const txsAddresses = [...txs.inputs.map(tx => tx.prev_out.addr), ...txs.out.map(tx => tx.addr)]

2
src/internals/usb/wallet/accounts.js

@ -113,7 +113,7 @@ export default async ({
}
const hdnode = getHDNode({ xpub58, network })
const account = await getAccount({ hdnode, network, segwit })
const account = await getAccount({ hdnode, network, segwit, asyncDelay: 0 })
onProgress({
account: currentAccount,

2
src/renderer/i18n.js

@ -8,7 +8,7 @@ i18n.use(Backend).init({
fallbackLng: 'en',
debug: false,
backend: {
loadPath: path.resolve(__dirname, '../i18n/{{lng}}/{{ns}}.yml'),
loadPath: path.join(__static, '/i18n/{{lng}}/{{ns}}.yml'),
},
react: {
wait: true,

0
src/i18n/en/translation.yml → static/i18n/en/translation.yml

0
src/i18n/fr/translation.yml → static/i18n/fr/translation.yml

26
yarn.lock

@ -3048,7 +3048,7 @@ doctrine@1.5.0:
esutils "^2.0.2"
isarray "^1.0.0"
doctrine@^2.0.0, doctrine@^2.1.0:
doctrine@^2.0.0, doctrine@^2.0.2, doctrine@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d"
dependencies:
@ -3602,13 +3602,13 @@ eslint-plugin-jsx-a11y@^6.0.3:
emoji-regex "^6.1.0"
jsx-ast-utils "^2.0.0"
eslint-plugin-react@^7.5.1:
version "7.5.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.5.1.tgz#52e56e8d80c810de158859ef07b880d2f56ee30b"
eslint-plugin-react@^7.6.0:
version "7.6.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.6.0.tgz#351651188c74c5b2fecc2717e3936b7207baa728"
dependencies:
doctrine "^2.0.0"
doctrine "^2.0.2"
has "^1.0.1"
jsx-ast-utils "^2.0.0"
jsx-ast-utils "^2.0.1"
prop-types "^15.6.0"
eslint-restricted-globals@^0.1.1:
@ -5386,7 +5386,7 @@ jsprim@^1.2.2:
json-schema "0.2.3"
verror "1.10.0"
jsx-ast-utils@^2.0.0:
jsx-ast-utils@^2.0.0, jsx-ast-utils@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-2.0.1.tgz#e801b1b39985e20fffc87b40e3748080e2dcac7f"
dependencies:
@ -5463,9 +5463,9 @@ levn@^0.3.0, levn@~0.3.0:
prelude-ls "~1.1.2"
type-check "~0.3.2"
lint-staged@^6.0.0:
version "6.0.1"
resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-6.0.1.tgz#855f2993ab4a265430e2fd9828427e648d65e6b4"
lint-staged@^6.1.0:
version "6.1.0"
resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-6.1.0.tgz#28f600c10a6cbd249ceb003118a1552e53544a93"
dependencies:
app-root-path "^2.0.0"
chalk "^2.1.0"
@ -8269,6 +8269,12 @@ source-map-support@^0.5.2:
dependencies:
source-map "^0.6.0"
source-map-support@^0.5.3:
version "0.5.3"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.3.tgz#2b3d5fff298cfa4d1afd7d4352d569e9a0158e76"
dependencies:
source-map "^0.6.0"
source-map-url@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3"

Loading…
Cancel
Save