New alias flow #96
| @ -1495,7 +1495,7 @@ func (h *MenuHandlers) ShowBlockedAccount(ctx context.Context, sym string, input | |||||||
| 	return res, nil | 	return res, nil | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // loadUserContent loads the main user content in the main menu: the alias,balance associated with active voucher
 | // loadUserContent loads the main user content in the main menu: the alias, balance and active symbol associated with active voucher
 | ||||||
| func loadUserContent(ctx context.Context, activeSym string, balance string, alias string) (string, error) { | func loadUserContent(ctx context.Context, activeSym string, balance string, alias string) (string, error) { | ||||||
| 	var content string | 	var content string | ||||||
| 
 | 
 | ||||||
| @ -1512,7 +1512,7 @@ func loadUserContent(ctx context.Context, activeSym string, balance string, alia | |||||||
| 	// format the final output
 | 	// format the final output
 | ||||||
| 	balStr := fmt.Sprintf("%s %s", formattedAmount, activeSym) | 	balStr := fmt.Sprintf("%s %s", formattedAmount, activeSym) | ||||||
| 	if alias != "" { | 	if alias != "" { | ||||||
| 		content = l.Get("%s balance: %s\n", alias, balStr) | 		content = l.Get("%s\n Balance: %s\n", alias, balStr) | ||||||
| 	} else { | 	} else { | ||||||
| 		content = l.Get("Balance: %s\n", balStr) | 		content = l.Get("Balance: %s\n", balStr) | ||||||
| 	} | 	} | ||||||
| @ -1525,7 +1525,6 @@ func (h *MenuHandlers) CheckBalance(ctx context.Context, sym string, input []byt | |||||||
| 	var ( | 	var ( | ||||||
| 		res     resource.Result | 		res     resource.Result | ||||||
| 		err     error | 		err     error | ||||||
| 		alias   string |  | ||||||
| 		content string | 		content string | ||||||
| 	) | 	) | ||||||
| 
 | 
 | ||||||
| @ -1560,11 +1559,8 @@ func (h *MenuHandlers) CheckBalance(ctx context.Context, sym string, input []byt | |||||||
| 			logg.ErrorCtxf(ctx, "failed to read account alias entry with", "key", storedb.DATA_ACCOUNT_ALIAS, "error", err) | 			logg.ErrorCtxf(ctx, "failed to read account alias entry with", "key", storedb.DATA_ACCOUNT_ALIAS, "error", err) | ||||||
| 			return res, err | 			return res, err | ||||||
| 		} | 		} | ||||||
| 	} else { |  | ||||||
| 		alias = strings.Split(string(accAlias), ".")[0] |  | ||||||
| 	} | 	} | ||||||
| 
 | 	content, err = loadUserContent(ctx, string(activeSym), string(activeBal), string(accAlias)) | ||||||
| 	content, err = loadUserContent(ctx, string(activeSym), string(activeBal), alias) |  | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		return res, err | 		return res, err | ||||||
| 	} | 	} | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user