From 775ab06f7c6217f08154b35b77620d32721546c2 Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Mon, 18 Mar 2024 16:46:30 +0530 Subject: [PATCH] Fixed: issue in redirection using GoToOms button by updating the regex for generating the link(#275) --- src/utils/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/index.ts b/src/utils/index.ts index 4af02b1..5f4bcfa 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -2,7 +2,7 @@ import { toastController } from "@ionic/vue"; import { translate } from "src"; const goToOms = (token: string, oms: string) => { - const link = (oms.startsWith('http') ? oms.replace(/api\/?/, "") : `https://${oms}.hotwax.io/`) + `commerce/control/main?token=${token}` + const link = (oms.startsWith('http') ? oms.replace(/\/api\/?|\/$/, "") : `https://${oms}.hotwax.io`) + `/commerce/control/main?token=${token}` window.open(link, '_blank', 'noopener, noreferrer') }