From bfec3d55e0dc64819c64c835cab77693f63e1707 Mon Sep 17 00:00:00 2001 From: Alexey Padalko Date: Fri, 16 Aug 2019 19:05:33 +0300 Subject: [PATCH] refactor: add use fallback settings item --- config/default.js | 1 + renderer/components/Request/Request.js | 2 +- .../components/Settings/SettingsFieldsWallet.js | 14 ++++++++++++-- renderer/components/Settings/messages.js | 2 ++ translations/en.json | 2 +- 5 files changed, 17 insertions(+), 4 deletions(-) diff --git a/config/default.js b/config/default.js index 10096cd28a9..4ebf759e21e 100644 --- a/config/default.js +++ b/config/default.js @@ -103,6 +103,7 @@ module.exports = { expire: 3600, baseRetryDelay: 1000, retryCount: 3, // Number of retries for pay invoice failure + useAddressFallback: false, }, autopay: { diff --git a/renderer/components/Request/Request.js b/renderer/components/Request/Request.js index 5dd4c9157cd..9bcf3551acf 100644 --- a/renderer/components/Request/Request.js +++ b/renderer/components/Request/Request.js @@ -1,7 +1,7 @@ import React from 'react' import PropTypes from 'prop-types' import { Flex } from 'rebass' -import { FormattedMessage, injectIntl } from 'react-intl' +import { FormattedMessage } from 'react-intl' import { intlShape } from '@zap/i18n' import { Bar, Button, Header, Panel, Span, Text, Tooltip } from 'components/UI' import { Form, Label, TextArea, Toggle } from 'components/Form' diff --git a/renderer/components/Settings/SettingsFieldsWallet.js b/renderer/components/Settings/SettingsFieldsWallet.js index acfc0bcdb77..c9fb317e661 100644 --- a/renderer/components/Settings/SettingsFieldsWallet.js +++ b/renderer/components/Settings/SettingsFieldsWallet.js @@ -4,11 +4,11 @@ import { injectIntl } from 'react-intl' import map from 'lodash/map' import get from 'lodash/get' import { Bar, DataRow } from 'components/UI' -import { Select } from 'components/Form' +import { Select, Toggle } from 'components/Form' import { getSupportedProviders } from '@zap/utils/rateProvider' +import { intlShape } from '@zap/i18n' import { FieldLabel, PositiveIntegerField } from './SettingsFieldHelpers' import messages from './messages' -import { intlShape } from '@zap/i18n' const addressItems = [{ key: 'p2wkh' }, { key: 'np2wkh' }] const addressMessageMapper = key => { @@ -95,7 +95,17 @@ const SettingsFieldsWallet = ({ currentConfig, intl }) => { /> } /> + + } + right={ + + } + /> {renderNumberDataRow('lndTargetConfirmations.fast')} diff --git a/renderer/components/Settings/messages.js b/renderer/components/Settings/messages.js index 2e28a1f3147..9b54767fd99 100644 --- a/renderer/components/Settings/messages.js +++ b/renderer/components/Settings/messages.js @@ -32,6 +32,8 @@ export default defineMessages({ address_option_np2wkh: 'Segwit', blockExplorer_label: 'Block explorer', blockExplorer_description: 'Your preferred block explorer.', + fallbackAddress_label: 'Enable on-chain address fallback', + fallbackAddress_description: 'Add on-chain fallback address to LN invoices.', invoices_expire_label: 'Invoice expiry', invoices_expire_description: 'Amount of time before invoices expire.', lndTargetConfirmations_slow_label: 'Target confirmations (slow)', diff --git a/translations/en.json b/translations/en.json index 2021a0f5f52..ba7d33b6dfc 100644 --- a/translations/en.json +++ b/translations/en.json @@ -529,7 +529,7 @@ "components.Settings.durationUnitSeconds": "{value} {value, plural, one {second} other {seconds}}", "components.Settings.durationUnitWeeks": "{value} {value, plural, one {week} other {weeks}}", "components.Settings.durationUnitYears": "{value} {value, plural, one {year} other {years}}", - "components.Settings.fallbackAddress_description": "Add fallback on-chain address to LN invoices.", + "components.Settings.fallbackAddress_description": "Add on-chain fallback address to LN invoices.", "components.Settings.fallbackAddress_label": "Enable on-chain address fallback", "components.Settings.fieldgroup_general": "General", "components.Settings.fieldgroup_wallet": "Wallet",