Merge pull request #6202 from ToolJet/fix/reserved-paths-conflict

fix: Tooljet is not loading the released apps which has some specific texts in sharable link path
This commit is contained in:
Akshay 2023-05-03 03:47:14 +05:30 committed by GitHub
commit 2fca5a1ef2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -75,7 +75,12 @@ class AppComponent extends React.Component {
'confirm',
'confirm-invite',
];
return existedPaths.find((path) => window.location.pathname.includes(path));
const subpath = getSubpath();
const subpathArray = subpath ? subpath.split('/').filter((path) => path != '') : [];
const pathnames = window.location.pathname.split('/')?.filter((path) => path != '');
const checkPath = () => existedPaths.find((path) => pathnames[subpath ? subpathArray.length : 0] === path);
return pathnames?.length > 0 ? (checkPath() ? true : false) : false;
};
componentDidMount() {