From 2ee09dbc674302c0daf23eddc20ea78dd3bb099b Mon Sep 17 00:00:00 2001 From: tienifr Date: Wed, 6 Dec 2023 14:38:59 +0700 Subject: [PATCH] move regex outside loop --- src/libs/ReportUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index f3ced9e781b5..52444a558214 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -3631,8 +3631,8 @@ function getRouteFromLink(url: string | null): string { // Get the reportID from URL let route = url; + const localWebAndroidRegEx = /^(https:\/\/([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3}))/; linkingConfig.prefixes.forEach((prefix) => { - const localWebAndroidRegEx = /^(https:\/\/([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3}))/; if (route.startsWith(prefix)) { route = route.replace(prefix, ''); } else if (localWebAndroidRegEx.test(route)) {