File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed
ui/packages/platform/src/components/ReportFile Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change 66 */
77
88import { Component , HTMLAttributeAnchorTarget } from 'react'
9- import { TextField , Button } from '@material-ui/core'
9+ import { Button , TextField } from '@material-ui/core'
1010import ReactMarkdown from 'react-markdown'
1111import rehypeRaw from 'rehype-raw'
1212import remarkGfm from 'remark-gfm'
@@ -124,15 +124,13 @@ const textAreaStyles = (
124124
125125class ReportFile extends Component < ReportFileWithStylesProps , ReportFileState > {
126126 getFileId ( ) {
127- let id = parseInt ( this . props . match . params . fileId , 10 )
128- /* eslint eqeqeq: 1 */
129- id =
130- id == parseInt ( this . props . match . params . fileId )
131- ? id
132- : parseInt ( this . props . match . params . fileId )
133- /* eslint eqeqeq: 0 */
134-
135- return id
127+ let fileID = this . props . match . params . fileId
128+ let parseID = parseInt ( fileID , 10 )
129+
130+ // To distinct different fileIDs. For example, "72215" and "1_1.sql".
131+ // {ORG_URL}/reports/268/files/72215/md
132+ // {ORG_URL}/reports/268/files/1_1.sql/sql?raw
133+ return ( fileID . toString ( ) == parseID . toString ( ) ) ? parseID : fileID
136134 }
137135
138136 componentDidMount ( ) {
You can’t perform that action at this time.
0 commit comments