🐛 fix no account error while only one
This commit is contained in:
@ -107,6 +107,11 @@ func GetAccount(name string) (Account, bool) {
|
|||||||
|
|
||||||
func GetAccountsByName(name string) []Account {
|
func GetAccountsByName(name string) []Account {
|
||||||
accounts := make([]Account, 0)
|
accounts := make([]Account, 0)
|
||||||
|
if AccountsCount() == 1 {
|
||||||
|
account, _ := GetAccount("")
|
||||||
|
accounts = append(accounts, account)
|
||||||
|
return accounts
|
||||||
|
}
|
||||||
for _, v := range accountsMap {
|
for _, v := range accountsMap {
|
||||||
if v.Name == name || v.Name == name+balance {
|
if v.Name == name || v.Name == name+balance {
|
||||||
accounts = append(accounts, v)
|
accounts = append(accounts, v)
|
||||||
|
Reference in New Issue
Block a user