Fix case of double slash
This commit is contained in:
parent
18c9acfa81
commit
efda44a20b
|
@ -13,7 +13,10 @@ const placeholder =
|
|||
const getProtectedUrl = (url?: string) => {
|
||||
if (url == undefined) return undefined
|
||||
|
||||
const imgUrl = new URL(`${import.meta.env.BASE_URL}/${url}`, location.origin)
|
||||
const imgUrl = new URL(
|
||||
`${import.meta.env.BASE_URL}${url}`.replace(/\/\//g, '/'),
|
||||
location.origin
|
||||
)
|
||||
|
||||
const tokenRegex = location.pathname.match(/^\/share\/([\d\w]+)(\/?.*)$/)
|
||||
if (tokenRegex) {
|
||||
|
|
Loading…
Reference in New Issue