mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-24 12:46:45 +00:00
check if opening uris is supported
This commit is contained in:
parent
425e476f20
commit
7cba0de268
1 changed files with 13 additions and 7 deletions
|
@ -601,6 +601,8 @@ public class AppServices {
|
|||
}
|
||||
|
||||
public static void addURIHandlers() {
|
||||
try {
|
||||
if(Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.APP_OPEN_URI)) {
|
||||
Desktop.getDesktop().setOpenURIHandler(event -> {
|
||||
URI uri = event.getURI();
|
||||
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) {
|
||||
try {
|
||||
|
|
Loading…
Reference in a new issue