Skip to content

Commit

Permalink
decodeURIComponent for search term in header
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalmi committed Dec 5, 2023
1 parent 50bd37f commit 7aa6cc8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/app/src/Pages/Layout/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Icon from "@/Icons/Icon";
export function Header() {
const navigate = useNavigate();
const location = useLocation();
const pageName = location.pathname.split("/")[1];
const pageName = decodeURIComponent(location.pathname.split("/")[1]);
const [nostrLink, setNostrLink] = useState<NostrLink | undefined>();
const { publicKey, tags } = useLogin();

Expand Down Expand Up @@ -47,7 +47,7 @@ export function Header() {

let title: React.ReactNode = <span className="capitalize">{pageName}</span>;
if (location.pathname.startsWith("/search/")) {
const searchTerm = location.pathname.split("/search/")[1];
const searchTerm = decodeURIComponent(location.pathname.split("/search/")[1]);
title = (
<>
<FormattedMessage defaultMessage="Search" id="xmcVZ0" />: {searchTerm}
Expand Down

0 comments on commit 7aa6cc8

Please sign in to comment.