Skip to content
This repository has been archived by the owner on Jun 7, 2023. It is now read-only.

Commit

Permalink
Merge branch develop into branch feature/realm
Browse files Browse the repository at this point in the history
  • Loading branch information
laumair committed Dec 20, 2018
2 parents 79214b8 + 2b71fcd commit c888501
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 27 deletions.
22 changes: 17 additions & 5 deletions src/desktop/src/ui/components/Balance.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { withI18n } from 'react-i18next';

import { getAccountNamesFromState } from 'selectors/accounts';

import { formatValue, formatUnit } from 'libs/iota/utils';
import { round, roundDown } from 'libs/utils';
import { getCurrencySymbol } from 'libs/currency';
Expand All @@ -28,6 +30,8 @@ class Balance extends React.PureComponent {
seedIndex: PropTypes.number.isRequired,
/** @ignore */
accounts: PropTypes.object.isRequired,
/** Wallet account names */
accountNames: PropTypes.array.isRequired,
/** @ignore */
settings: PropTypes.object.isRequired,
/** @ignore */
Expand Down Expand Up @@ -58,13 +62,20 @@ class Balance extends React.PureComponent {
}

render() {
const { summary, index, accounts, switchAccount, seedIndex, settings, marketData, t } = this.props;
const {
summary,
index,
accounts,
accountNames,
switchAccount,
seedIndex,
settings,
marketData,
t,
} = this.props;
const { balanceIsShort } = this.state;

const accountName =
summary && index === -1
? t('totalBalance')
: Object.keys(accounts.accountInfo)[summary ? index : seedIndex];
const accountName = summary && index === -1 ? t('totalBalance') : accountNames[summary ? index : seedIndex];

const accountBalance =
summary && index === -1
Expand Down Expand Up @@ -108,6 +119,7 @@ class Balance extends React.PureComponent {
const mapStateToProps = (state) => ({
seedIndex: state.wallet.seedIndex,
accounts: state.accounts,
accountNames: getAccountNamesFromState(state),
marketData: state.marketData,
settings: state.settings,
});
Expand Down
7 changes: 5 additions & 2 deletions src/desktop/src/ui/views/settings/Index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { withI18n } from 'react-i18next';
import { connect } from 'react-redux';

import { shorten } from 'libs/iota/converter';
import { getAccountNamesFromState } from 'selectors/accounts';

import Icon from 'ui/components/Icon';
import Scrollbar from 'ui/components/Scrollbar';
Expand Down Expand Up @@ -33,6 +34,8 @@ class Settings extends React.PureComponent {
static propTypes = {
/** @ignore */
accounts: PropTypes.object,
/** Wallet account names */
accountNames: PropTypes.array.isRequired,
/** @ignore */
wallet: PropTypes.object,
/** @ignore */
Expand All @@ -48,13 +51,12 @@ class Settings extends React.PureComponent {
};

render() {
const { accounts, location, wallet, history, t } = this.props;
const { accounts, accountNames, location, wallet, history, t } = this.props;
const { accountIndex } = this.props.match.params;

const backRoute = wallet.ready ? '/wallet/' : '/onboarding/';

const accountSettings = typeof accountIndex === 'string';
const accountNames = Object.keys(accounts);

const account = accountSettings
? { ...accounts[accountNames[accountIndex]], ...{ accountName: accountNames[accountIndex], accountIndex } }
Expand Down Expand Up @@ -198,6 +200,7 @@ class Settings extends React.PureComponent {

const mapStateToProps = (state) => ({
accounts: state.accounts.accountInfo,
accountNames: getAccountNamesFromState(state),
wallet: state.wallet,
});

Expand Down
9 changes: 7 additions & 2 deletions src/desktop/src/ui/views/wallet/Sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { shorten, capitalize } from 'libs/iota/converter';
import { formatIota } from 'libs/iota/utils';

import { clearWalletData, setSeedIndex } from 'actions/wallet';
import { getAccountNamesFromState } from 'selectors/accounts';

import Logo from 'ui/components/Logo';
import Icon from 'ui/components/Icon';
Expand All @@ -22,6 +23,8 @@ import css from './index.scss';
*/
class Sidebar extends React.PureComponent {
static propTypes = {
/** Account names for wallet */
accountNames: PropTypes.array.isRequired,
/** @ignore */
location: PropTypes.object,
/** @ignore */
Expand Down Expand Up @@ -80,7 +83,8 @@ class Sidebar extends React.PureComponent {
};

render() {
const { accounts, seedIndex, setSeedIndex, t, location, history, isBusy } = this.props;
// Use accountNames prop for displaying account names here because accountNames prop preserves the account index
const { accountNames, accounts, seedIndex, setSeedIndex, t, location, history, isBusy } = this.props;
const { modalLogout } = this.state;

return (
Expand All @@ -96,7 +100,7 @@ class Sidebar extends React.PureComponent {
</a>
<ul>
<Scrollbar>
{Object.keys(accounts.accountInfo).map((account, index) => {
{accountNames.map((account, index) => {
return (
<a
aria-current={index === seedIndex}
Expand Down Expand Up @@ -147,6 +151,7 @@ class Sidebar extends React.PureComponent {
}

const mapStateToProps = (state) => ({
accountNames: getAccountNamesFromState(state),
accounts: state.accounts,
seedIndex: state.wallet.seedIndex,
isBusy:
Expand Down
8 changes: 4 additions & 4 deletions src/mobile/android/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,14 @@ GEM
mime-types-data (~> 3.2015)
mime-types-data (3.2018.0812)
mini_magick (4.5.1)
mini_portile2 (2.3.0)
mini_portile2 (2.4.0)
multi_json (1.13.1)
multi_xml (0.6.0)
multipart-post (2.0.0)
nanaimo (0.2.6)
naturally (2.2.0)
nokogiri (1.8.4)
mini_portile2 (~> 2.3.0)
nokogiri (1.9.1)
mini_portile2 (~> 2.4.0)
os (1.0.0)
plist (3.4.0)
public_suffix (2.0.5)
Expand Down Expand Up @@ -164,4 +164,4 @@ DEPENDENCIES
nokogiri

BUNDLED WITH
1.16.4
1.17.2
8 changes: 6 additions & 2 deletions src/shared/containers/components/List.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import map from 'lodash/map';
import { connect } from 'react-redux';
import { withI18n } from 'react-i18next';
import { getSelectedAccountName } from '../../selectors/accounts';
import { getSelectedAccountName, getAccountNamesFromState } from '../../selectors/accounts';

import { generateAlert } from '../../actions/alerts';
import { toggleEmptyTransactions } from '../../actions/settings';
Expand Down Expand Up @@ -39,6 +39,8 @@ export default function withListData(ListComponent) {
retryFailedTransaction: PropTypes.func.isRequired,
remotePoW: PropTypes.bool.isRequired,
generateAlert: PropTypes.func.isRequired,
/** Wallet account names */
accountNames: PropTypes.array.isRequired,
};

promoteTransaction = (hash, powFn) => {
Expand All @@ -51,6 +53,7 @@ export default function withListData(ListComponent) {

render() {
const {
accountNames,
index,
seedIndex,
accounts,
Expand All @@ -72,7 +75,7 @@ export default function withListData(ListComponent) {

const isBusy = ui.isSyncing || ui.isSendingTransfer || ui.isAttachingToTangle || ui.isTransitioning;

const accountName = Object.keys(accounts.accountInfo)[typeof index === 'number' ? index : seedIndex];
const accountName = accountNames[typeof index === 'number' ? index : seedIndex];

if (!accountName && index !== -1) {
return null;
Expand Down Expand Up @@ -120,6 +123,7 @@ export default function withListData(ListComponent) {
accounts: state.accounts,
accountName: getSelectedAccountName(state),
theme: getThemeFromState(state),
accountNames: getAccountNamesFromState(state),
mode: state.settings.mode,
ui: state.ui,
hideEmptyTransactions: state.settings.hideEmptyTransactions,
Expand Down
4 changes: 2 additions & 2 deletions src/shared/locales/cs/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@
},
"accountManagement": {
"viewSeed": "Zobrazit Seed",
"viewAddresses": "Zobrazit adresu",
"viewAddresses": "Zobrazení adres",
"editAccountName": "Upravit název účtu",
"deleteAccount": "Smazat účet",
"addNewAccount": "Přidat nový účet",
Expand Down Expand Up @@ -705,7 +705,7 @@
"newVersionAvailable": "K dispozici je nová verze",
"newVersionAvailableExplanation": "A new Trinity version is available. Do you want to update now?",
"installUpdate": "Nainstalujte aktualizaci a restartujte",
"installUpdateExplanation": "Stahování bylo dokončeno, Trinity restartuje a nainstaluje aktualizaci.",
"installUpdateExplanation": "Stahování bylo dokončeno, Trinity se nyní restartuje a poté nainstaluje aktualizaci.",
"downloadingUpdate": "Stahování aktualizace",
"downloadProgress": "Staženo {{transferred}} z {{total}}"
},
Expand Down
12 changes: 6 additions & 6 deletions src/shared/locales/es-ES/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"invalidResponseFetchingAccountDesktop": "Error al intentar obtener información del nodo. Si el problema persiste intente cambiar el nodo o deshabilite el proxy en la configuración.",
"nodeOutOfSync": "Nodo desincronizado",
"nodeOutOfSyncExplanation": "Su nodo seleccionado esta desincronizado. Por favor cámbielo y pruebe devuelta.",
"experimentalNode": "Node version not supported",
"experimentalNodeExplanation": "Your currently selected node is running an experimental version which is not supported. Please change node or try again.",
"experimentalNode": "Versión del nodo no soportada",
"experimentalNodeExplanation": "Su versión actual de nodo está ejecutando una versión experimental que no es soportada. Por favor cambie el nodo o reintente.",
"thisNodeOutOfSync": "Este nodo no está sincronizado. Por favor, cambie de nodo o pruebe de nuevo.",
"seed": "Semilla",
"checksum": "Checksum",
Expand Down Expand Up @@ -76,8 +76,8 @@
"wallet": "Cartera",
"all": "Todo",
"sent": "Enviada",
"youReceived": "You received",
"youSent": "You sent",
"youReceived": "Usted recibió",
"youSent": "Usted envío",
"received": "Recibida",
"sending": "Enviando",
"receiving": "Recibiendo",
Expand Down Expand Up @@ -132,7 +132,7 @@
"spentAddressExplanation": "ALERTA: Fondos en direcciones usadas",
"discordInformation": "Enviar desde la misma dirección más de una vez es peligroso. Por favor diríjase al canal #help en Discord para averiguar qué puede hacer.",
"androidInsecureClipboardWarning": "Android no ofrece un portapapeles seguro.",
"androidCopyPasteWarning": "Never copy/paste a seed on an Android device.",
"androidCopyPasteWarning": "Nunca copié/pegue una semilla en un dispositivo Android.",
"willNotCopyPasteSeed": "No copiaré/pegaré mi semilla",
"mustBeStoredAppropriately": "Debe ser almacenado apropiadamente.",
"deviceMayBecomeUnresponsive": "Su dispositivo puede estar sin responder por un rato.",
Expand All @@ -152,7 +152,7 @@
"errorAccessingKeychain": "Error de keychain",
"errorAccessingKeychainExplanation": "No se puede acceder a la keychain requerida para almacenamiento seguro.",
"mainWallet": "CUENTA PRINCIPAL",
"confirm": "Confirm",
"confirm": "Confirmar",
"delete": "Delete",
"shouldUpdate": "Hay una nueva actualización disponible",
"shouldUpdateExplanation": "Hay una nueva actualización disponible. Siempre es recomendado actualizar a la ultima version.",
Expand Down
2 changes: 1 addition & 1 deletion src/shared/locales/ja/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
"enterPassword": "パスワードを入力してください。",
"login": "ログイン",
"setNode": "ノードの設定",
"whyBiometricDisabled": "生体認証が無効になっている理由",
"whyBiometricDisabled": "生体認証が無効になっている理由",
"whyBiometricDisabledExplanationPart1": "安全性のため、初回のアプリ起動時には生体認証が無効になっています。",
"whyBiometricDisabledExplanationPart2": "Trinityを使用していると、非アクティブのためにログアウトすることがあります。その時には、生体認証を使用して再度ログインすることができます。"
},
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -979,9 +979,9 @@ cross-spawn@^6.0.0:
which "^1.2.9"

cryptiles@3.x.x:
version "3.1.2"
resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-3.1.2.tgz#a89fbb220f5ce25ec56e8c4aa8a4fd7b5b0d29fe"
integrity sha1-qJ+7Ig9c4l7FboxKqKT9e1sNKf4=
version "3.1.4"
resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-3.1.4.tgz#769a68c95612b56faadfcebf57ac86479cbe8322"
integrity sha512-8I1sgZHfVwcSOY6mSGpVU3lw/GSIZvusg8dD2+OGehCJpOhQRLNcH0qb9upQnOH4XhgxxFJSg6E2kx95deb1Tw==
dependencies:
boom "5.x.x"

Expand Down

0 comments on commit c888501

Please sign in to comment.