fix: subpath

This commit is contained in:
Muhsin Shah 2023-05-02 00:39:56 +05:30
parent 80b020507c
commit 8251c289de

View file

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