Skip to content

Commit

Permalink
Update website
Browse files Browse the repository at this point in the history
  • Loading branch information
BenSeage committed Nov 11, 2023
1 parent c18489d commit ec85cc4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions website/app/[locale]/(root)/play/Play.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export default function Play(props: any) {

const createQueryString = useCallback(
(name: string, value: any) => {
const params = new URLSearchParams(searchParams);
const params = new URLSearchParams(location.search);
if (!value) {
params.delete(name)
} else {
Expand All @@ -152,7 +152,7 @@ export default function Play(props: any) {

return params.toString();
},
[searchParams],
[],
);

useEffect(() => {
Expand Down Expand Up @@ -191,13 +191,13 @@ export default function Play(props: any) {
}, [currentTabTitle, shareItem.files])

useEffect(() => {
if (searchParams.get('layout') !== layout) {
if (new URLSearchParams(location.search).get('layout') !== layout) {
router.push(pathname + '?' + createQueryString('layout', layout))
}
}, [createQueryString, layout, pathname, router, searchParams, shareId])

useEffect(() => {
if (searchParams.get('preview') !== preview) {
if (new URLSearchParams(location.search).get('preview') !== preview) {
router.push(pathname + '?' + createQueryString('preview', preview))
}
}, [createQueryString, pathname, preview, router, searchParams, shareId])
Expand Down

0 comments on commit ec85cc4

Please sign in to comment.