Skip to content

Commit

Permalink
fix prefix add twice
Browse files Browse the repository at this point in the history
  • Loading branch information
darkskygit committed Jan 4, 2020
1 parent a927a13 commit 8cbc550
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion web/src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import xf from './xfetch'
const subdir = window.props.subdir

export function getSubDirPath(path) {
if (typeof path === 'string') {
if (
typeof path === 'string' &&
!path.startsWith(`${subdir}/`) &&
!path.startsWith(`/${subdir}/`)
) {
if (path.startsWith('/')) {
return `/${subdir}${path}`
} else {
Expand Down

0 comments on commit 8cbc550

Please sign in to comment.