From 70e1683a1cda40c61072f8d2c1f380ba6a72567f Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Thu, 17 Aug 2023 18:22:56 +0530 Subject: [PATCH] Fixed: issue of goToOms button working when url contains api/ but not working when it contains api only(#121) --- src/utils/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/index.ts b/src/utils/index.ts index 4382bf0..4d54a2b 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -1,5 +1,6 @@ const goToOms = (token: string, oms: string) => { - const link = (oms.startsWith('http') ? oms.replace('api/', "") : `https://${oms}.hotwax.io/`) + `?token=${token}` + const link = (oms.startsWith('http') ? oms.replace(/api\/?/, "") : `https://${oms}.hotwax.io/`) + `?token=${token}` + window.open(link, '_blank', 'noopener, noreferrer') }