rename address-formatting function

This commit is contained in:
sneurlax 2023-03-07 14:55:05 -06:00
parent 8bb41255ea
commit e98ad2971a
2 changed files with 9 additions and 10 deletions

View file

@ -591,7 +591,7 @@ class _SendViewState extends ConsumerState<SendView> {
_address = _address!.substring(0, _address!.indexOf("\n")); _address = _address!.substring(0, _address!.indexOf("\n"));
} }
sendToController.text = httpXOREpicBox(_address!); sendToController.text = formatAddress(_address!);
} }
}); });
} }
@ -923,8 +923,7 @@ class _SendViewState extends ConsumerState<SendView> {
if (coin == if (coin ==
Coin.epicCash) { Coin.epicCash) {
// strip http:// and https:// if content contains @ // strip http:// and https:// if content contains @
content = content = formatAddress(
httpXOREpicBox(
content); content);
} }
sendToController.text = sendToController.text =
@ -1778,8 +1777,8 @@ class _SendViewState extends ConsumerState<SendView> {
} }
} }
// strip http:// and https:// if epicAddress contains @ String formatAddress(String epicAddress) {
String httpXOREpicBox(String epicAddress) { // strip http:// or https:// prefixes if the address contains an @ symbol (and is thus an epicbox address)
if ((epicAddress.startsWith("http://") || if ((epicAddress.startsWith("http://") ||
epicAddress.startsWith("https://")) && epicAddress.startsWith("https://")) &&
epicAddress.contains("@")) { epicAddress.contains("@")) {

View file

@ -580,7 +580,7 @@ class _DesktopSendState extends ConsumerState<DesktopSend> {
if (coin == Coin.epicCash) { if (coin == Coin.epicCash) {
// strip http:// and https:// if content contains @ // strip http:// and https:// if content contains @
content = httpXOREpicBox(content); content = formatAddress(content);
} }
sendToController.text = content; sendToController.text = content;
@ -758,7 +758,7 @@ class _DesktopSendState extends ConsumerState<DesktopSend> {
_address = _address!.substring(0, _address!.indexOf("\n")); _address = _address!.substring(0, _address!.indexOf("\n"));
} }
sendToController.text = httpXOREpicBox(_address!); sendToController.text = formatAddress(_address!);
} }
}); });
} }
@ -1345,8 +1345,8 @@ class _DesktopSendState extends ConsumerState<DesktopSend> {
} }
} }
// strip http:// and https:// if epicAddress contains @ String formatAddress(String epicAddress) {
String httpXOREpicBox(String epicAddress) { // strip http:// or https:// prefixes if the address contains an @ symbol (and is thus an epicbox address)
if ((epicAddress.startsWith("http://") || if ((epicAddress.startsWith("http://") ||
epicAddress.startsWith("https://")) && epicAddress.startsWith("https://")) &&
epicAddress.contains("@")) { epicAddress.contains("@")) {