mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-11 13:14:32 +00:00
Merge branch 'staging' into fix/epic-listener
This commit is contained in:
commit
2c05b13a5f
2 changed files with 66 additions and 0 deletions
|
@ -580,6 +580,22 @@ class _SendViewState extends ConsumerState<SendView> {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// add listener for epic cash to strip http:// and https:// prefixes if the address also ocntains an @ symbol (indicating an epicbox address)
|
||||||
|
if (coin == Coin.epicCash) {
|
||||||
|
sendToController.addListener(() {
|
||||||
|
_address = sendToController.text;
|
||||||
|
|
||||||
|
if (_address != null && _address!.isNotEmpty) {
|
||||||
|
_address = _address!.trim();
|
||||||
|
if (_address!.contains("\n")) {
|
||||||
|
_address = _address!.substring(0, _address!.indexOf("\n"));
|
||||||
|
}
|
||||||
|
|
||||||
|
sendToController.text = httpXOREpicBox(_address!);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return Background(
|
return Background(
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
|
backgroundColor: Theme.of(context).extension<StackColors>()!.background,
|
||||||
|
@ -904,6 +920,13 @@ class _SendViewState extends ConsumerState<SendView> {
|
||||||
"\n"));
|
"\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (coin ==
|
||||||
|
Coin.epicCash) {
|
||||||
|
// strip http:// and https:// if content contains @
|
||||||
|
content =
|
||||||
|
httpXOREpicBox(
|
||||||
|
content);
|
||||||
|
}
|
||||||
sendToController.text =
|
sendToController.text =
|
||||||
content;
|
content;
|
||||||
_address = content;
|
_address = content;
|
||||||
|
@ -1754,3 +1777,14 @@ class _SendViewState extends ConsumerState<SendView> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// strip http:// and https:// if epicAddress contains @
|
||||||
|
String httpXOREpicBox(String epicAddress) {
|
||||||
|
if ((epicAddress.startsWith("http://") ||
|
||||||
|
epicAddress.startsWith("https://")) &&
|
||||||
|
epicAddress.contains("@")) {
|
||||||
|
epicAddress = epicAddress.replaceAll("http://", "");
|
||||||
|
epicAddress = epicAddress.replaceAll("https://", "");
|
||||||
|
}
|
||||||
|
return epicAddress;
|
||||||
|
}
|
||||||
|
|
|
@ -578,6 +578,11 @@ class _DesktopSendState extends ConsumerState<DesktopSend> {
|
||||||
content = content.substring(0, content.indexOf("\n"));
|
content = content.substring(0, content.indexOf("\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (coin == Coin.epicCash) {
|
||||||
|
// strip http:// and https:// if content contains @
|
||||||
|
content = httpXOREpicBox(content);
|
||||||
|
}
|
||||||
|
|
||||||
sendToController.text = content;
|
sendToController.text = content;
|
||||||
_address = content;
|
_address = content;
|
||||||
|
|
||||||
|
@ -742,6 +747,22 @@ class _DesktopSendState extends ConsumerState<DesktopSend> {
|
||||||
final String locale = ref.watch(
|
final String locale = ref.watch(
|
||||||
localeServiceChangeNotifierProvider.select((value) => value.locale));
|
localeServiceChangeNotifierProvider.select((value) => value.locale));
|
||||||
|
|
||||||
|
// add listener for epic cash to strip http:// and https:// prefixes if the address also ocntains an @ symbol (indicating an epicbox address)
|
||||||
|
if (coin == Coin.epicCash) {
|
||||||
|
sendToController.addListener(() {
|
||||||
|
_address = sendToController.text;
|
||||||
|
|
||||||
|
if (_address != null && _address!.isNotEmpty) {
|
||||||
|
_address = _address!.trim();
|
||||||
|
if (_address!.contains("\n")) {
|
||||||
|
_address = _address!.substring(0, _address!.indexOf("\n"));
|
||||||
|
}
|
||||||
|
|
||||||
|
sendToController.text = httpXOREpicBox(_address!);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return Column(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
|
@ -1323,3 +1344,14 @@ class _DesktopSendState extends ConsumerState<DesktopSend> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// strip http:// and https:// if epicAddress contains @
|
||||||
|
String httpXOREpicBox(String epicAddress) {
|
||||||
|
if ((epicAddress.startsWith("http://") ||
|
||||||
|
epicAddress.startsWith("https://")) &&
|
||||||
|
epicAddress.contains("@")) {
|
||||||
|
epicAddress = epicAddress.replaceAll("http://", "");
|
||||||
|
epicAddress = epicAddress.replaceAll("https://", "");
|
||||||
|
}
|
||||||
|
return epicAddress;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue