Fix delimiter used for combined fields copypaste.

This commit is contained in:
yonson2023 2023-01-25 10:46:45 -06:00
parent 74e1078318
commit 0b049d5a52
No known key found for this signature in database
GPG Key ID: 653F31AF4087E2F2

View File

@ -58,21 +58,17 @@ public class TextFieldWithCopyIcon extends AnchorPane {
copyIcon.setOnMouseClicked(e -> { copyIcon.setOnMouseClicked(e -> {
String text = getText(); String text = getText();
if (text != null && text.length() > 0) { if (text != null && text.length() > 0) {
String copyText; String copyText = text;
if (copyWithoutCurrencyPostFix) { if (copyWithoutCurrencyPostFix) {
String[] strings = text.split(" "); String[] strings = text.split(" ");
if (strings.length > 1) if (strings.length > 1) {
copyText = strings[0]; // exclude the BTC postfix copyText = strings[0]; // exclude the BTC postfix
else }
copyText = text;
} else if (copyTextAfterDelimiter) { } else if (copyTextAfterDelimiter) {
String[] strings = text.split(" "); String[] strings = text.split("/");
if (strings.length > 1) if (strings.length == 2) {
copyText = strings[2]; // exclude the part before / (slash included) copyText = strings[1].stripLeading(); // exclude the part before / (slash included)
else }
copyText = text;
} else {
copyText = text;
} }
Utilities.copyToClipboard(copyText); Utilities.copyToClipboard(copyText);
} }