From f2463d021dc2c7dfe0f3b68c3454b23c8989eecf Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Fri, 5 May 2023 14:09:02 -0600 Subject: [PATCH] Handle Helena Express deep links with the home page barcode scanner --- www/assets/js/home.js | 5 +++++ www/assets/js/platform.js | 3 +++ 2 files changed, 8 insertions(+) diff --git a/www/assets/js/home.js b/www/assets/js/home.js index a7653e2..afe224c 100644 --- a/www/assets/js/home.js +++ b/www/assets/js/home.js @@ -33,6 +33,8 @@ function openGenericBarcodeScanner() { } else if (trackingcoderegex.test(result)) { code = result; action = "track"; + } else if (result.startsWith("https://helena.express/")) { + action = "hlnexurl"; } switch (action) { @@ -49,6 +51,9 @@ function openGenericBarcodeScanner() { router.navigate("/crypto?paymenturi=" + code); //app.dialog.alert("Not implemented."); break; + case "hlnexurl": + handleDeepLink(result); + break; default: app.dialog.alert("This app can't understand what's in that barcode.", "Error"); return; diff --git a/www/assets/js/platform.js b/www/assets/js/platform.js index 27f129a..a39f97e 100644 --- a/www/assets/js/platform.js +++ b/www/assets/js/platform.js @@ -159,6 +159,9 @@ function handleDeepLink(href) { break; case "/app": break; + case "/app/get": + app.dialog.alert("You already have the Helena Express app. You're using it right now!", "Hi there!"); + break; case "/track": if (link.fragment) { router.navigate("/track/" + link.fragment);