Browse Source

check if opening uris is supported

terminal
Craig Raw 4 years ago
parent
commit
7cba0de268
  1. 6
      src/main/java/com/sparrowwallet/sparrow/AppServices.java

6
src/main/java/com/sparrowwallet/sparrow/AppServices.java

@ -601,6 +601,8 @@ public class AppServices {
} }
public static void addURIHandlers() { public static void addURIHandlers() {
try {
if(Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.APP_OPEN_URI)) {
Desktop.getDesktop().setOpenURIHandler(event -> { Desktop.getDesktop().setOpenURIHandler(event -> {
URI uri = event.getURI(); URI uri = event.getURI();
if("bitcoin".equals(uri.getScheme())) { if("bitcoin".equals(uri.getScheme())) {
@ -610,6 +612,10 @@ public class AppServices {
} }
}); });
} }
} catch(Exception e) {
log.error("Could not add URI handler", e);
}
}
private static void openBitcoinUri(URI uri) { private static void openBitcoinUri(URI uri) {
try { try {

Loading…
Cancel
Save