From e98ad2971a1179f1d57a992144fa5e487c691f3a Mon Sep 17 00:00:00 2001 From: sneurlax Date: Tue, 7 Mar 2023 14:55:05 -0600 Subject: [PATCH] rename address-formatting function --- lib/pages/send_view/send_view.dart | 11 +++++------ .../wallet_view/sub_widgets/desktop_send.dart | 8 ++++---- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/lib/pages/send_view/send_view.dart b/lib/pages/send_view/send_view.dart index e850e07d8..b8bcc1f6d 100644 --- a/lib/pages/send_view/send_view.dart +++ b/lib/pages/send_view/send_view.dart @@ -591,7 +591,7 @@ class _SendViewState extends ConsumerState { _address = _address!.substring(0, _address!.indexOf("\n")); } - sendToController.text = httpXOREpicBox(_address!); + sendToController.text = formatAddress(_address!); } }); } @@ -923,9 +923,8 @@ class _SendViewState extends ConsumerState { if (coin == Coin.epicCash) { // strip http:// and https:// if content contains @ - content = - httpXOREpicBox( - content); + content = formatAddress( + content); } sendToController.text = content; @@ -1778,8 +1777,8 @@ class _SendViewState extends ConsumerState { } } -// strip http:// and https:// if epicAddress contains @ -String httpXOREpicBox(String epicAddress) { +String formatAddress(String epicAddress) { + // strip http:// or https:// prefixes if the address contains an @ symbol (and is thus an epicbox address) if ((epicAddress.startsWith("http://") || epicAddress.startsWith("https://")) && epicAddress.contains("@")) { diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_send.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_send.dart index c349eeb9d..588af3fd0 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_send.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_send.dart @@ -580,7 +580,7 @@ class _DesktopSendState extends ConsumerState { if (coin == Coin.epicCash) { // strip http:// and https:// if content contains @ - content = httpXOREpicBox(content); + content = formatAddress(content); } sendToController.text = content; @@ -758,7 +758,7 @@ class _DesktopSendState extends ConsumerState { _address = _address!.substring(0, _address!.indexOf("\n")); } - sendToController.text = httpXOREpicBox(_address!); + sendToController.text = formatAddress(_address!); } }); } @@ -1345,8 +1345,8 @@ class _DesktopSendState extends ConsumerState { } } -// strip http:// and https:// if epicAddress contains @ -String httpXOREpicBox(String epicAddress) { +String formatAddress(String epicAddress) { + // strip http:// or https:// prefixes if the address contains an @ symbol (and is thus an epicbox address) if ((epicAddress.startsWith("http://") || epicAddress.startsWith("https://")) && epicAddress.contains("@")) {