mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-25 05:06: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,14 +601,20 @@ public class AppServices {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void addURIHandlers() {
|
public static void addURIHandlers() {
|
||||||
Desktop.getDesktop().setOpenURIHandler(event -> {
|
try {
|
||||||
URI uri = event.getURI();
|
if(Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.APP_OPEN_URI)) {
|
||||||
if("bitcoin".equals(uri.getScheme())) {
|
Desktop.getDesktop().setOpenURIHandler(event -> {
|
||||||
Platform.runLater(() -> openBitcoinUri(uri));
|
URI uri = event.getURI();
|
||||||
} else if("aopp".equals(uri.getScheme())) {
|
if("bitcoin".equals(uri.getScheme())) {
|
||||||
Platform.runLater(() -> openAddressOwnershipProof(uri));
|
Platform.runLater(() -> openBitcoinUri(uri));
|
||||||
|
} else if("aopp".equals(uri.getScheme())) {
|
||||||
|
Platform.runLater(() -> openAddressOwnershipProof(uri));
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
} catch(Exception e) {
|
||||||
|
log.error("Could not add URI handler", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void openBitcoinUri(URI uri) {
|
private static void openBitcoinUri(URI uri) {
|
||||||
|
|
Loading…
Reference in a new issue