From 51f7a85fe6c1bfba7f0bff3a16717d3049c3c982 Mon Sep 17 00:00:00 2001 From: Percs <83934299+Percslol@users.noreply.github.com> Date: Mon, 15 Jul 2024 15:15:15 -0500 Subject: [PATCH] proxy historystate properly --- src/client/history.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/history.ts b/src/client/history.ts index cd16dc7..eb80602 100644 --- a/src/client/history.ts +++ b/src/client/history.ts @@ -1,8 +1,8 @@ -import { decodeUrl } from "./shared"; +import { encodeUrl } from "./shared"; window.history.pushState = new Proxy(window.history.pushState, { apply(target, thisArg, argArray) { - argArray[2] = decodeUrl(argArray[2]); + argArray[2] = encodeUrl(argArray[2]); return Reflect.apply(target, thisArg, argArray); }, @@ -10,7 +10,7 @@ window.history.pushState = new Proxy(window.history.pushState, { window.history.replaceState = new Proxy(window.history.replaceState, { apply(target, thisArg, argArray) { - argArray[2] = decodeUrl(argArray[2]); + argArray[2] = encodeUrl(argArray[2]); return Reflect.apply(target, thisArg, argArray); },