Handle Helena Express deep links with the home page barcode scanner

master
Skylar Ittner 1 year ago
parent ed1f4dddcf
commit f2463d021d

@ -33,6 +33,8 @@ function openGenericBarcodeScanner() {
} else if (trackingcoderegex.test(result)) { } else if (trackingcoderegex.test(result)) {
code = result; code = result;
action = "track"; action = "track";
} else if (result.startsWith("https://helena.express/")) {
action = "hlnexurl";
} }
switch (action) { switch (action) {
@ -49,6 +51,9 @@ function openGenericBarcodeScanner() {
router.navigate("/crypto?paymenturi=" + code); router.navigate("/crypto?paymenturi=" + code);
//app.dialog.alert("Not implemented."); //app.dialog.alert("Not implemented.");
break; break;
case "hlnexurl":
handleDeepLink(result);
break;
default: default:
app.dialog.alert("This app can't understand what's in that barcode.", "Error"); app.dialog.alert("This app can't understand what's in that barcode.", "Error");
return; return;

@ -159,6 +159,9 @@ function handleDeepLink(href) {
break; break;
case "/app": case "/app":
break; 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": case "/track":
if (link.fragment) { if (link.fragment) {
router.navigate("/track/" + link.fragment); router.navigate("/track/" + link.fragment);

Loading…
Cancel
Save