mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-23 10:07:35 +00:00
Make trailing slash optional
This commit is contained in:
parent
9d8c9afc09
commit
4fe17d95c5
1 changed files with 10 additions and 8 deletions
|
|
@ -27,14 +27,16 @@ const urlChangedEpic = (actions) =>
|
|||
actions.pipe(
|
||||
filter((action) => action.type === "URL_CHANGED"),
|
||||
switchMap((action) => {
|
||||
if (action.location.pathname === "/about/") {
|
||||
return of(Actions.requestedAboutPage());
|
||||
}
|
||||
if (action.location.pathname === "/upload/") {
|
||||
return of(Actions.requestedUploadPage());
|
||||
}
|
||||
if (action.location.pathname === "/review/") {
|
||||
return of(Actions.requestedReviewPage());
|
||||
const pathname = action.location.pathname.replace("/$", "");
|
||||
switch (pathname) {
|
||||
case "/about":
|
||||
return of(Actions.requestedAboutPage());
|
||||
case "/upload":
|
||||
return of(Actions.requestedUploadPage());
|
||||
case "/review":
|
||||
return of(Actions.requestedReviewPage());
|
||||
default:
|
||||
//
|
||||
}
|
||||
const params = new URLSearchParams(action.location.search);
|
||||
const query = params != null && params.get("query");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue