Skip to content

Commit

Permalink
Matching route modification
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyan committed Dec 12, 2024
1 parent 8ffae82 commit 9c555e6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion web/src/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ const Header: React.FC = () => {
const { location } = history;
let pathname = location?.pathname;
const intl = useIntl();
if(pathname.indexOf('chat_room')!=-1){ pathname = '/chat_room'}
//chat_room Check whether the route is a dynamic one
if(pathname.indexOf('chat_room')!=-1){
let pathnameArray:any = pathname.split('/')
let isPathnameId = pathnameArray[pathnameArray.length-1] - 1
if(!isNaN(isPathnameId)){ pathname = '/chat_room'}
}

const menuList = [
{
name: intl.formatMessage({ id: 'component.menu.dashboard', defaultMessage: '' }),
Expand Down

0 comments on commit 9c555e6

Please sign in to comment.