mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Correct hashtag link routing
This commit is contained in:
parent
92df820323
commit
7759e54fd4
@ -8,9 +8,9 @@ export default async ({ store, env, route, redirect }) => {
|
||||
}
|
||||
|
||||
const regX = build('^/search/hashtag/((\\pL+[\\pL0-9]*)|([0-9]+\\pL+[\\pL0-9]*))$')
|
||||
const matchHashtag = exec(decodeURI(route.name), regX)
|
||||
const matchHashtag = route.fullPath ? exec(decodeURI(route.fullPath), regX) : null
|
||||
|
||||
if (!matchHashtag) return true
|
||||
|
||||
return redirect(`/?hashtag=${encodeURI(matchHashtag[0])}`)
|
||||
return redirect(`/?hashtag=${encodeURI(matchHashtag[1])}`)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user