diff --git a/src/lib/utils.js b/src/lib/utils.js index 02b58ff4..caad77a3 100644 --- a/src/lib/utils.js +++ b/src/lib/utils.js @@ -26,6 +26,23 @@ function isBoolean(val) { return typeof(val) === 'boolean'; } +function getCategorizedAccounts(allAccounts) { + const ret = {}; + + for (let i = 0; i < allAccounts.length; i++) { + const account = allAccounts[i]; + + if (!ret[account.category]) { + ret[account.category] = []; + } + + const accountList = ret[account.category]; + accountList.push(account); + } + + return ret; +} + export default { isFunction, isObject, @@ -33,4 +50,5 @@ export default { isString, isNumber, isBoolean, + getCategorizedAccounts, }; diff --git a/src/views/mobile/accounts/AccountList.vue b/src/views/mobile/accounts/AccountList.vue index f784016a..c7921a8f 100644 --- a/src/views/mobile/accounts/AccountList.vue +++ b/src/views/mobile/accounts/AccountList.vue @@ -1,5 +1,5 @@