diff --git a/src/app/pages/pathUtils.ts b/src/app/pages/pathUtils.ts index db2c55a50..305599645 100644 --- a/src/app/pages/pathUtils.ts +++ b/src/app/pages/pathUtils.ts @@ -73,17 +73,17 @@ export const getAppPathFromHref = (baseUrl: string, href: string): string => { export const getRootPath = (): string => ROOT_PATH; export const getLoginPath = (server?: string): string => { - const params = server ? { server: encodeURIComponent(server) } : undefined; + const params = server ? { server } : undefined; return generatePath(LOGIN_PATH, params); }; export const getRegisterPath = (server?: string): string => { - const params = server ? { server: encodeURIComponent(server) } : undefined; + const params = server ? { server } : undefined; return generatePath(REGISTER_PATH, params); }; export const getResetPasswordPath = (server?: string): string => { - const params = server ? { server: encodeURIComponent(server) } : undefined; + const params = server ? { server } : undefined; return generatePath(RESET_PASSWORD_PATH, params); }; @@ -93,8 +93,8 @@ export const getHomeJoinPath = (): string => HOME_JOIN_PATH; export const getHomeSearchPath = (): string => HOME_SEARCH_PATH; export const getHomeRoomPath = (roomIdOrAlias: string, eventId?: string): string => { const params = { - roomIdOrAlias: encodeURIComponent(roomIdOrAlias), - eventId: eventId ? encodeURIComponent(eventId) : null, + roomIdOrAlias, + eventId: eventId ?? null, }; return generatePath(HOME_ROOM_PATH, params); @@ -104,8 +104,8 @@ export const getDirectPath = (): string => DIRECT_PATH; export const getDirectCreatePath = (): string => DIRECT_CREATE_PATH; export const getDirectRoomPath = (roomIdOrAlias: string, eventId?: string): string => { const params = { - roomIdOrAlias: encodeURIComponent(roomIdOrAlias), - eventId: eventId ? encodeURIComponent(eventId) : null, + roomIdOrAlias, + eventId: eventId ?? null, }; return generatePath(DIRECT_ROOM_PATH, params); @@ -113,20 +113,20 @@ export const getDirectRoomPath = (roomIdOrAlias: string, eventId?: string): stri export const getSpacePath = (spaceIdOrAlias: string): string => { const params = { - spaceIdOrAlias: encodeURIComponent(spaceIdOrAlias), + spaceIdOrAlias, }; return generatePath(SPACE_PATH, params); }; export const getSpaceLobbyPath = (spaceIdOrAlias: string): string => { const params = { - spaceIdOrAlias: encodeURIComponent(spaceIdOrAlias), + spaceIdOrAlias, }; return generatePath(SPACE_LOBBY_PATH, params); }; export const getSpaceSearchPath = (spaceIdOrAlias: string): string => { const params = { - spaceIdOrAlias: encodeURIComponent(spaceIdOrAlias), + spaceIdOrAlias, }; return generatePath(SPACE_SEARCH_PATH, params); }; @@ -136,9 +136,9 @@ export const getSpaceRoomPath = ( eventId?: string, ): string => { const params = { - spaceIdOrAlias: encodeURIComponent(spaceIdOrAlias), - roomIdOrAlias: encodeURIComponent(roomIdOrAlias), - eventId: eventId ? encodeURIComponent(eventId) : null, + spaceIdOrAlias, + roomIdOrAlias, + eventId: eventId ?? null, }; return generatePath(SPACE_ROOM_PATH, params); @@ -148,7 +148,7 @@ export const getExplorePath = (): string => EXPLORE_PATH; export const getExploreFeaturedPath = (): string => EXPLORE_FEATURED_PATH; export const getExploreServerPath = (server: string): string => { const params = { - server: encodeURIComponent(server), + server, }; return generatePath(EXPLORE_SERVER_PATH, params); };