Browse Source

example regexp exec (#25200)

tags/2.0.0-beta.2^2
Asuka Minato 1 month ago
parent
commit
19e1cbd033
No account linked to committer's email address

+ 1
- 1
web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/panel.tsx View File

const Panel: FC = () => { const Panel: FC = () => {
const { t } = useTranslation() const { t } = useTranslation()
const pathname = usePathname() const pathname = usePathname()
const matched = pathname.match(/\/app\/([^/]+)/)
const matched = /\/app\/([^/]+)/.exec(pathname)
const appId = (matched?.length && matched[1]) ? matched[1] : '' const appId = (matched?.length && matched[1]) ? matched[1] : ''
const { isCurrentWorkspaceEditor } = useAppContext() const { isCurrentWorkspaceEditor } = useAppContext()
const readOnly = !isCurrentWorkspaceEditor const readOnly = !isCurrentWorkspaceEditor

Loading…
Cancel
Save