clean up location proxy

This commit is contained in:
Percs 2024-07-13 21:21:30 -05:00
parent 4ce4226afa
commit 38f7a5e5a7

View file

@ -1,18 +1,12 @@
// @ts-nocheck
import { encodeUrl, decodeUrl } from "../shared";
function urlLocation() {
export function LocationProxy() {
const loc = new URL(decodeUrl(location.href));
loc.assign = (url: string) => location.assign(encodeUrl(url));
loc.reload = () => location.reload();
loc.replace = (url: string) => location.replace(encodeUrl(url));
loc.toString = () => loc.href;
return loc;
}
export function LocationProxy() {
const loc = urlLocation();
return new Proxy(window.location, {
get(target, prop) {