@chat21/chat21-web-widget 5.1.0-rc17 → 5.1.0-rc18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,9 @@
6
6
  ### **Copyrigth**:
7
7
  *Tiledesk SRL*
8
8
 
9
+ # 5.1.0-rc18
10
+ - **bug-fixed**: allowedOnSpecificUrl
11
+
9
12
  # 5.1.0-rc17
10
13
  - **added**: allowedOnSpecificUrl and allowedOnSpecificUrlList to manage list of pattern url to allow to load the widget
11
14
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@chat21/chat21-web-widget",
3
3
  "author": "Tiledesk SRL",
4
- "version": "5.1.0-rc17",
4
+ "version": "5.1.0-rc18",
5
5
  "license": "MIT",
6
6
  "homepage": "https://www.tiledesk.com",
7
7
  "repository": {
@@ -1977,8 +1977,13 @@ export class GlobalSettingsService {
1977
1977
  }
1978
1978
 
1979
1979
  manageLoadingDomains(): boolean {
1980
+ const { allowedOnSpecificUrl, allowedOnSpecificUrlList } = this.globals;
1981
+
1982
+ if(!allowedOnSpecificUrl){
1983
+ return true
1984
+ }
1980
1985
 
1981
- if(this.globals.allowedOnSpecificUrl && (!this.globals.allowedOnSpecificUrlList || this.globals.allowedOnSpecificUrlList.length === 0) ){
1986
+ if (!Array.isArray(allowedOnSpecificUrlList) || allowedOnSpecificUrlList.length === 0) {
1982
1987
  console.log('allowedOnSpecificUrl is true and allowedOnSpecificUrlList is empty or not set');
1983
1988
  return true
1984
1989
  }
@@ -1992,7 +1997,7 @@ export class GlobalSettingsService {
1992
1997
  }
1993
1998
 
1994
1999
  const currentUrl = this.globals.windowContext.location.href;
1995
- const shouldShow = this.globals.allowedOnSpecificUrlList.some(pattern => {
2000
+ const shouldShow = allowedOnSpecificUrlList.some(pattern => {
1996
2001
  const regex = wildcardToRegex(pattern);
1997
2002
  return regex.test(currentUrl);
1998
2003
  });