Commit ee700abc authored by ZeHiro's avatar ZeHiro Committed by ZeHiro
Browse files

Format IBAN correctly. Fixes #477

parent a017294f
Pipeline #9512 passed with stage
in 2 minutes and 15 seconds
...@@ -8,6 +8,10 @@ import ConfirmDeleteModal from '../../ui/confirm-delete-modal'; ...@@ -8,6 +8,10 @@ import ConfirmDeleteModal from '../../ui/confirm-delete-modal';
import AddOperationModal from './add-operation-modal'; import AddOperationModal from './add-operation-modal';
import SyncAccountBalanceModal from './sync-account-balance-modal'; import SyncAccountBalanceModal from './sync-account-balance-modal';
const formatIBAN = function(iban) {
return iban.replace(/(.{4})(?!$)/g, `$1\xa0`);
};
export default connect(state => { export default connect(state => {
let defaultAccountId = get.setting(state, 'defaultAccountId'); let defaultAccountId = get.setting(state, 'defaultAccountId');
return { return {
...@@ -25,7 +29,7 @@ export default connect(state => { ...@@ -25,7 +29,7 @@ export default connect(state => {
})(props => { })(props => {
let a = props.account; let a = props.account;
let label = a.iban ? `${a.title} (IBAN: ${a.iban})` : a.title; let label = a.iban ? `${a.title} (IBAN\xa0:\xa0${formatIBAN(a.iban)})` : a.title;
let selected; let selected;
let setDefaultAccountTitle; let setDefaultAccountTitle;
......
...@@ -55,7 +55,7 @@ export let fetchAccounts = async (access) => { ...@@ -55,7 +55,7 @@ export let fetchAccounts = async (access) => {
accountNumber: main, accountNumber: main,
label: 'Compte chèque', label: 'Compte chèque',
balance: Math.random() * 150, balance: Math.random() * 150,
iban: '235711131719', iban: 'FR235711131719',
currency: 'EUR' currency: 'EUR'
}, },
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment