Skip to content

Commit

Permalink
fix: Navigate correctly to the original article (#1205)
Browse files Browse the repository at this point in the history
  • Loading branch information
dohooo authored Dec 27, 2023
1 parent d951be5 commit 21f9475
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/site/ViewOriginal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ export default function ViewOriginal({ page }: { page: ExpandedNote }) {
<span
className="ml-1 underline cursor-pointer"
onClick={() => {
// remove the locale search param
const url = new URL(window.location.href)
url.searchParams.delete("locale")
window.history.replaceState({}, "", url.toString())

document.cookie = `NEXT_LOCALE=${page?.metadata?.content?.translatedFrom};`
window.location.reload()
}}
Expand Down

0 comments on commit 21f9475

Please sign in to comment.